View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Moh Moh is offline
external usenet poster
 
Posts: 58
Default 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