Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I'm trying to create a macro to select a range of data from one sheet and place that range in the next unfilled range on another sheet. Also when I create a macro and save the file, then quit. The macro is gone the next time I come back?

Hi,
Regarding losing your Macro:
Where did you write your Macro code?
Was it in a standard module such as Module1 attached to the workbook that you are writing the code for, or are have you created an Add-In workbook.
Regarding copying a range to the next 'unfilled' range, are you copying several ranges on the source worksheet to the destination worksheet all in one go, or are you intending to copy data from the source Worksheet to the destination Worksheet at different times, perhaps after closing and reopening the Workbook.
I ask this because if it is the first case, some form of program loop is likely appropriate whilst in the second case, it may be necessary to do a test on the destination worksheet to identify where the existing data ends, and hence where the empty cells start.
Regards

I started by recording a macro and then editing that macro. I would then save the excel file and it would tell me that I need to save it as a macro-enabled worksheet or something like that. So I'd save as that kind of file but when I went back into the file the macro was gone. I hope that helps

When you started to record the macro, you were asked where to store it - This workbook, new workbook etc.
So the macro may not have been recorded in the workbook you are using.
In your other post, Case Statement w/ Excel the instructions given, will save the code in the workbook with the "Current" and "YTD" worksheets and will be in the "Current" worksheet object in the VBA window.
Regards

![]() |
Excell 2007 data comparis...
|
Case Statement w/ Excel
|
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |