Jagwarman
asked on
Insert data to the right of last days data
Could an expert help me out with this one please
I have attached a file that has sheet 1 and sheet 2. Think of sheet 1 as the starting point and sheet 2 after the code has bee run.
Each day the report is run and each day I need to add a new column to the right of the last day working days data. So on sheet 1 you will see there are 3 days 1/4, 2/4 and 3/4
So today I need VBA code that will insert today to the right of 3/4 and include all of the conditional formats that are in the cells. I also need there to be 3 blank columns between the last day and the column headed 'Type'
Sheet 2 is what I need it to look like after the Macro has run.
I hope that explains it clearly.
Thanks in advance
Insert.xlsx
I have attached a file that has sheet 1 and sheet 2. Think of sheet 1 as the starting point and sheet 2 after the code has bee run.
Each day the report is run and each day I need to add a new column to the right of the last day working days data. So on sheet 1 you will see there are 3 days 1/4, 2/4 and 3/4
So today I need VBA code that will insert today to the right of 3/4 and include all of the conditional formats that are in the cells. I also need there to be 3 blank columns between the last day and the column headed 'Type'
Sheet 2 is what I need it to look like after the Macro has run.
I hope that explains it clearly.
Thanks in advance
Insert.xlsx
ASKER
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
robertbaron
I get Run-time error '1004' : Method 'Range' of object'_Global' failed at this line of code with your macro
Range("month_today").Entir eColumn.Se lect
is that because I have to put month_start and month_today inspecific cells?
I get Run-time error '1004' : Method 'Range' of object'_Global' failed at this line of code with your macro
Range("month_today").Entir
is that because I have to put month_start and month_today inspecific cells?
yes. look at my example sheet.
name J3 as month_start.
name the last cell (eg K3/L3) as month_today.
they get reassigned as necessary by the macro,
name J3 as month_start.
name the last cell (eg K3/L3) as month_today.
they get reassigned as necessary by the macro,
ASKER
both excellent thank you
ASKER
1) I have uploaded a new file because the dates in the original could cause confusion so I have changed to dates in May as they originally showed April.
2) The file will be used for the entire month so when we move into a new month the first working day of the new month needs to start in column J and all other dates from previous month needs to be cleared.
Many thanks