Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello, could really use some help with something. I am trying to
write an Excel macro that will do the following: 1. Use whatever cell I currently have selected on any given sheet as a relative cell. 2. Go back one sheet (using PreviousSheet) and copy the data from that same relative cell. 3. Paste that data into the relative cell on the given sheet I was on. I have 13 sheets and I want to copy the data from a specific cell on one sheet to the same cell on the next sheet. The sheets and cells have to be non-specific in the macro to allow me to run the macro on any of my 13 sheets and any of the cells on that sheet. If I record the macro as I do it I end up with the following in VBA: Range("C12).Select Sheets("Sheet 3").Select Range("C12").Select Selection.Copy Sheets("Sheet 4").Select Range("C12").Select Selection.PasteSpecial Paste:=x1PasteValues, Operation:=x1None, SkipBlanks _ :=False, Transpose:=False Obviously, from my explanation, I need to replace the "C12" reference so the macro just runs from whatever cell I have selected, and the "Sheet 3" and "Sheet 4" refrences have to be replaced to allow the macro to run from whatever sheet I'm currently on and go back one sheet to copy the data. I've been using PreviousSheet which I set up awhile ago and has worked great for my other macros in this spreadsheet. I just can't get this one to work. Any help anyone can offer would be greatly appreciated. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Linking cells from the previous sheet | Excel Discussion (Misc queries) | |||
Protect Sheet: clicking in cells removes all previous text | Excel Discussion (Misc queries) | |||
Protect Sheet: clicking in cells removes all previous text | Excel Discussion (Misc queries) | |||
Relative reference to a cell on a previous sheet | Excel Discussion (Misc queries) | |||
How do I make a 5th sheet to total cells from previous sheets in . | Excel Worksheet Functions |