Question : Excel Conditional Column Input

I have a moderately large spreadsheet with employee times for shift start, lunch start, lunch end, and shift end separated by day.  So, for each day, each name on the list should have four entries.  I have the spreadsheet in a horizontal view format with all times back to back.  I would like help in creating a macro that will check each row by date and fill in info for that date, leaving blank any missing entries.  For instance, if there are no times for 12/13, I'd like those cells to be empty and the data to be shifted to the right automatically for 12/14, the next recorded entry.  Is this possible?  Can anyone help?  I've attached a sample spreadsheet with data.  Any advice would be greatly appreciated.

Answer : Excel Conditional Column Input

Here's another way to look at it.  Don't run a macro but have a separate sheet with pre-built formulas to line everything up correctly.  You could then save this as a template and just dump the data in each week.

Step 1 - create a reference page
Step 2 - name a range for the start date on the reference page
Step 3 - create an "output" sheet.
Step 4 - name a range (work.range) on your original data.
Look at the attached example - all this will make sense -

using vlookup for each name, test the "day" using the day function to see if the day matches the column header (12/13) for example, if it matches, the true value becomes the date and time from your original data, if it does not make, just enter nothing "".  You're not 'moving; anything if over, but rather testing to see if the source data matches the criteria you setup.

Check out the example - good luck!

Rob
 
Example of data on 1 tab, report on another
 
Random Solutions  
 
programming4us programming4us