G
Guest
I'm trying to write a macro copies and pastes monthly data from one sheet to
another. In some areas there may not be any data every month meaning that
there is nothing to copy and paste. At the moment I am simply searching for
the end column of the source sheet and copying and pasting the data over to
the new sheet. But if I do this in a month where there is no new data it
will end up copying across data from a previous month.
To get around this I can get the user to enter this months date in to the
macro workbook before they run the macro and then write in an if function to
check that the data in the end column of the source sheet is the same as the
date in the macro workbook. Can someone please tell me what script I need to
add in to the macro? I basically want it to copy the data (I have the script
for this) if the dates match and not copy the data and move on to the next
part of the sub if the dates don't match.
Here is some more info:
- The cell in the source sheet will already be active so the macro will need
to compare the active cell against a cell in the macro workbook.
- Let's say the macro workbook is called "macroworkbook" and the cell is D3
another. In some areas there may not be any data every month meaning that
there is nothing to copy and paste. At the moment I am simply searching for
the end column of the source sheet and copying and pasting the data over to
the new sheet. But if I do this in a month where there is no new data it
will end up copying across data from a previous month.
To get around this I can get the user to enter this months date in to the
macro workbook before they run the macro and then write in an if function to
check that the data in the end column of the source sheet is the same as the
date in the macro workbook. Can someone please tell me what script I need to
add in to the macro? I basically want it to copy the data (I have the script
for this) if the dates match and not copy the data and move on to the next
part of the sub if the dates don't match.
Here is some more info:
- The cell in the source sheet will already be active so the macro will need
to compare the active cell against a cell in the macro workbook.
- Let's say the macro workbook is called "macroworkbook" and the cell is D3