Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
copy back macro/roll back
Hi,
I have two tabs within one workbook. One is called 'current tab' second one is called 'previous tab'. I am trying to create a macro in the current tab that will delete all values within the 'previous tab' and replace it with the values from the 'current tab'. In other words, the values in the 'current tab' is moved to 'previous tab'. Can anyone help? Thanks |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
copy back macro/roll back
This will do it but you should be aware that all the contents of previous tab
will be overwritten and lost. Sub Copyonetoanother() Sheets("Previous Tab").Select Cells.Select Selection.ClearContents Sheets("Current Tab").Select Cells.Select Selection.Copy Sheets("Previous Tab").Select ActiveSheet.Paste End Sub "moh" wrote: Hi, I have two tabs within one workbook. One is called 'current tab' second one is called 'previous tab'. I am trying to create a macro in the current tab that will delete all values within the 'previous tab' and replace it with the values from the 'current tab'. In other words, the values in the 'current tab' is moved to 'previous tab'. Can anyone help? Thanks |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
copy back macro/roll back
"All" values..........?
Record yourself deleting "previous" sheet and making a copy of "current" sheet. Gord Dibben MS Excel MVP On Thu, 1 Mar 2007 02:50:00 -0800, moh wrote: Hi, I have two tabs within one workbook. One is called 'current tab' second one is called 'previous tab'. I am trying to create a macro in the current tab that will delete all values within the 'previous tab' and replace it with the values from the 'current tab'. In other words, the values in the 'current tab' is moved to 'previous tab'. Can anyone help? Thanks |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
copy back macro/roll back
Hi Mike,
Thanks for taking the time out to solve the issue. However I have one more issue, I wounder if you can help. Both previous and current tabs have data according to months. Now I would like to modify a fixed range and set paramaters so that everytime you press roll back macro the next month (new column) appears in the worksheet automatically. This is an extract of the cuurent range macro: Range("M6:AB68").Select I would like to somehow change the range "AB68" and set a parameter, so that everytime you press roll back, the next month (a new column) appears automatically. For example, I have months Jan 07, Feb 07, Mar 07. Now when I click the roll back macro, obviously al data will dissapear to previous tab overwriting other data. At the same time I would like the macro to show a new column (April 07) automatically. Could you please help me setup this parameter? Many Thanks, Moh "Mike" wrote: This will do it but you should be aware that all the contents of previous tab will be overwritten and lost. Sub Copyonetoanother() Sheets("Previous Tab").Select Cells.Select Selection.ClearContents Sheets("Current Tab").Select Cells.Select Selection.Copy Sheets("Previous Tab").Select ActiveSheet.Paste End Sub "moh" wrote: Hi, I have two tabs within one workbook. One is called 'current tab' second one is called 'previous tab'. I am trying to create a macro in the current tab that will delete all values within the 'previous tab' and replace it with the values from the 'current tab'. In other words, the values in the 'current tab' is moved to 'previous tab'. Can anyone help? Thanks |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
copy back macro/roll back
Hi,
Thanks for taking the time out to solve the issue. However I have one more issue, I wounder if you can help. Both previous and current tabs have data according to months. Jan - Dec 07. Now I would like to modify a fixed range and set paramaters on the macro so that everytime you press roll back macro ,the next month (new column) appears in the worksheet automatically as well as pasting the new information on previous tab. This is an extract of the current range macro: this is fixed but I need to change it to set a parameter. Range("M6:AB68").Select . For example, you can assume M6 is Jan 07, M7 is Feb 07, and AB is Dec 07. Now when I click the roll back macro, obviously al data will dissapear to previous tab overwriting other data. At the same time I would like the macro to show a new column (Jan 08) automatically. I would like to somehow show me how to change the fixed range "AB68" and set a parameter, so that everytime you press roll back, the next month (a new column) appears automatically in order to dates. Could you please help me setup this parameter? Many Thanks, Moh "Gord Dibben" wrote: "All" values..........? Record yourself deleting "previous" sheet and making a copy of "current" sheet. Gord Dibben MS Excel MVP On Thu, 1 Mar 2007 02:50:00 -0800, moh wrote: Hi, I have two tabs within one workbook. One is called 'current tab' second one is called 'previous tab'. I am trying to create a macro in the current tab that will delete all values within the 'previous tab' and replace it with the values from the 'current tab'. In other words, the values in the 'current tab' is moved to 'previous tab'. Can anyone help? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel macro settings change back to low | Excel Discussion (Misc queries) | |||
Go back to where you were before the Macro | Excel Discussion (Misc queries) | |||
Reverse a Macro - works like back button | Excel Discussion (Misc queries) | |||
How can we back up a permanant copy of an excel file automaticaly | Excel Discussion (Misc queries) | |||
Roll back to previous date | Excel Worksheet Functions |