Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
how would activate the previous sheet in macro
Hi,
Every day I insert the new sheet in the source file I have various sheets in a file with different sheet names. I have recorded a macro in excel file to pull the data from Previous sheet whenever I run the macro, the sheet names are always different. Is it possible to select the latest or previous sheet. -- Vikram Dhemare |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
how would activate the previous sheet in macro
You can use the index maybe
Sub test() If ActiveSheet.Index = 1 Then Exit Sub MsgBox Sheets(ActiveSheet.Index - 1).Range("A1").Value End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Vicky" wrote in message ... Hi, Every day I insert the new sheet in the source file I have various sheets in a file with different sheet names. I have recorded a macro in excel file to pull the data from Previous sheet whenever I run the macro, the sheet names are always different. Is it possible to select the latest or previous sheet. -- Vikram Dhemare |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro to change data in inactive sheet | Excel Discussion (Misc queries) | |||
macro to change data in inactive sheet | Excel Discussion (Misc queries) | |||
Macro to change data in a sheet | Excel Discussion (Misc queries) | |||
checking that cells have a value before the workbook will close | Excel Worksheet Functions | |||
Closing File Error | Excel Discussion (Misc queries) |