Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old March 1st 07, 10:50 AM posted to microsoft.public.excel.worksheet.functions
Moh Moh is offline
external usenet poster
 
First recorded activity by ExcelBanter: Sep 2006
Posts: 58
Default 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   Report Post  
Old March 1st 07, 10:57 AM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2006
Posts: 3,101
Default 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   Report Post  
Old March 1st 07, 05:35 PM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2006
Posts: 22,907
Default 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   Report Post  
Old March 5th 07, 01:51 PM posted to microsoft.public.excel.worksheet.functions
Moh Moh is offline
external usenet poster
 
First recorded activity by ExcelBanter: Sep 2006
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

  #5   Report Post  
Old March 5th 07, 02:19 PM posted to microsoft.public.excel.worksheet.functions
Moh Moh is offline
external usenet poster
 
First recorded activity by ExcelBanter: Sep 2006
Posts: 58
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel macro settings change back to low john mcmichael Excel Discussion (Misc queries) 1 May 8th 06 11:12 PM
Go back to where you were before the Macro Trintrin Excel Discussion (Misc queries) 2 March 29th 06 08:38 PM
Reverse a Macro - works like back button spydor Excel Discussion (Misc queries) 1 January 3rd 06 12:39 AM
How can we back up a permanant copy of an excel file automaticaly Gita Excel Discussion (Misc queries) 2 July 30th 05 12:46 AM
Roll back to previous date Jay Excel Worksheet Functions 2 December 3rd 04 03:35 PM


All times are GMT +1. The time now is 10:27 PM.

Powered by vBulletin® Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright 2004-2021 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"

 

Copyright © 2017