Please see attached sample/test file.
Using Office 365 Excel
I recorded a macro (which is the only way I know how to get VBA code).
This macro is then assigned to the button at the top of tab "Log" (says "ONLY Press..."). I do want to keep the button to execute this code.
When this button is pressed here's what I'm trying to get it to do:
1. Do not RUN/UPDATE anything if there aren't any blank records in Columns K & L (K & L will always have data whereas columns L-AN may or may not have data). Warn and tell the user with a pop-up that nothing was updated. Give user a button to click OK to close this pop-up window.
2. The User will input a date range (can be the same date) into cells C1-C2. This will refresh a query on the tab "DataLookup" which will load the data that will be needed for the tab "Log".
3. The User will then input a few records (could be 1 record, could be 5 or more, but normal is none or 1-3 per day) into the next empty row on the table (tbl_Log) found on the tab "Log". I've input "9" and "10" in column A to simulate 2 entries a user might do.
4. Once the user has input the info in the blue section (Columns A-I), they will then press the BUTTON at the top (shown in Columns J-M)
5. This button will then do the following...
As mentioned above, it may do nothing and tell the user nothing was updated (i.e. say the user hits the button but hasn't added any new records).
In most cases, the user will correctly make a new entry (like 9 & 10 in Column A in this example) and when they press this macro button...
a. The vlookup formulas on tab "Lists" in Cells Q9-AT9 (which is also a named range called "rng_Vlookups") will be copied into all empty rows where Column K is empty on tab "Log".
[On the tab "Lists", cell S4, I have a basic formula to count the # of empty cells and therefore the # of rows that the vlookup formulas need to be copied into, in this case it would be copied to cells K14-AN15. I was thinking that this simple count could somehow be used to determine how many rows/records are needed for the vlookup formulas to be copied?]
b. Once copied, the macro will then do a Copy>Paste-Special Values so that the data pulled into cells K14-AN15 will be hard-coded.
c. Then I need the macro to hit "ESC" to get out of Copy/Paste mode (so that the cells are no longer highlighted/encapsulated by the dash lines)
d. Then have the macro hit "Home" so that the user is returned to the far left side of the screen (doesn't matter to me if they end up on row 14 or 15 or 16, just as long as we throw them to the far left so it's basically ready for new entries tomorrow.
e. If you can tell the user how many records had data imported that would be great.
You CAN press the button to see at least what I'm attempting to have done.
Appreciate any assistance with how to make this work efficiently!!!
Bookmarks