Posts by AJBudda

    The code you supplied works; sort of. For my database, the number of rows is never a set number but the number of columns will stay the same. In my current worksheet data, there are 64 rows and 119 columns (118 TextBoxs * one ComboBox). In line 5 of the code you supplied you had “For x = 1 to 26” which works fine but it only returns values for the first 26 TextBoxes. I changed that number to 118 and I got an error message stating “Could not find the specific object.” The highest value I could put “For x = 1 to 63” and anything greater than 63 returns the error message.


    I can’t figure out why it’s stopping at 63 (looks like it's tied to how many rows there are) and not at 118. Any ideas? Thanks

    $20 Paid to OzGrid: Attahment outlines what I'm looking for. Excel userform also attached


    I have a large data base with lots of columns/rows and is a pain to keep scrolling through all those columns to look up information and also to add or edit info in that data base. The data comes from another server that I download and then paste into this excel worksheet.


    I have lots of dates that I must update so I decided to build a user form in excel (total novice and watched YouTube videos to get this far) so I can see all of the data on one page.


    I have a combobox which has a dropdown where I select a project name and then all of my textbox’s are filled with the data and dates associated with that project into my user form via VLOOKUP


    There are 2 parts to my request;

    • Part 1: Has to do with dealing with dates and is explained on page 2 of the attached pdf document.
    • Part 2: Once I select a project from the dropdown box in my userform, I would like to be able to edit any dates in my userform textboxes and have the new entered dates update the worksheet with the new dates. These date boxes would need a format command added so that dates are formatted correctly or the user gets an error. {I think there is a command along the lines of ShortDate that would seem to work)


    Only the dates need to be able to update the data base and not any of the textbox’s at the top of the userform.



    I know these can be done because I did get some of it to work (the coloring schemes for part II and also to edit and replace data in the worksheet) but I figured an expert would kick these out in no time. Here is the part that I couldn’t find any info on;



    I would like all date edits that were inputted on the userform and then were written to the worksheet show up as GREEN text or GREEN backgrounds on the worksheet. I need to be able to tell what I changed so when I go to the server I can make the changes there.



    IF you need any more info let me know. Thanks

    I should have added that dates start at TextBox9 (Forecast Date) so of course the first box I would want to see if not empty would be TextBox10 (Actual Date). If TextBox is not empty then nothing to do and go to TextBox12 (paired with TextBox11). If TextBox10 is empty then the color routine I was looking for above would now come into play and would be used on TextBox9 (and so on...TextBox13 & Textbox14.......TextBox15 and Textbox16.....etc)

    My Spreadsheet has at least 16 columns that contain dates; the first date is a forecast date of when the task will be completed and the 2nd column is the actual date the task was completed.



    The first 8 columns list First Name, Last Name, ID#, Address, City, State, Zip, and County. The remaining columns as I said are for forecast and completed tasks. Code is below and I uploaded a PDF of what the userform looks like…


    For some reason it doesn't work when I use the "AfterUpdate" but sort of works when I use "Change" instead. It also seems to be ignoring if Textbox2 is empty or not because when I run it, it will color TextBox1if it has a past due date even though it shouldn't because textbox2 had a date in it already which means skip with coloring textbox1.


    Any ideas?


    Also curious how this works with no End If statement

    I created a userform in excel to be used for displaying data from an excel worksheet. When an item is selected from a combo box drop-down list, it populates all of the textboxes with the corresponding information. Many of the combo boxes contain dates. One box shows a FORECAST date of when a task will be completed and the other box shows the ACTUAL date of when that task was completed. Here is what I'm looking to do:


    1) Compare the FORECAST textbox to the ACTUAL text box...if there is a date in the ACTUAL text box then do nothing but if there isn't a date in the ACTUAL box then do the following

    2) f there is a date in the FORECAST box and the date is currently more than 6 days from today's date, then do nothing and keep background color as the normal WHITE

    3) If there is a date in the FORECAST box and the date is currently less then 5 days from today's date, then turn the forecast box background color to YELLOW

    4) If there is a date in the FORECAST box and If the forecast date is now past today's date then turn the forecast background color to RED


    I'm really new to userforms and textboxes so not sure if the textbox needs to know that I'm working with dates and not text (or are dates considered text?) so that might be some of the issues I've been having. Thanks for your help.....