Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Vicky
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Ron de Bruin
 
Posts: n/a
Default 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
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
macro to change data in inactive sheet Diana Excel Discussion (Misc queries) 1 April 28th 06 08:36 PM
macro to change data in inactive sheet Diana Excel Discussion (Misc queries) 1 April 28th 06 08:10 PM
Macro to change data in a sheet Diana Excel Discussion (Misc queries) 1 April 28th 06 08:01 PM
checking that cells have a value before the workbook will close kcdonaldson Excel Worksheet Functions 8 December 5th 05 04:57 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM


All times are GMT +1. The time now is 03:37 AM.

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

About Us

"It's about Microsoft Excel"