View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ryan H Ryan H is offline
external usenet poster
 
Posts: 489
Default Including tab name in absolute reference

Your post is kinda vague, plus you didn't post any of your current code.
When you say "spreadsheets" do you mean workbooks? And when you say "tabs" I
assume you mean worksheets within the workbook, right? But I think you want
to activate a sheet in a particular workbook before a particular macro is
ran, right? If so, you can use this code below. It sounds to me you need a
loop referencing workbooks and sheets, which would be more efficient. Hope
this helps! If so, let me know, click "YES" below.

Sub YourSub()

Workbooks("Book1.xls").Sheets("Sheet1").Activate

' your code for that worksheet here

Workbooks("Book1.xls").Sheets("Sheet2").Activate

' your code for that worksheet here
'etc

End Sub
--
Cheers,
Ryan


"Brad" wrote:

I have lots of spreadsheets that have the same seven tabs in them. How do I
automatically ensure that the correct tab is selected when running a macro
with absolute references? Is there a way to have the macro select the tab
before running the rest of the macro?

Brad

Excel 2002 on XP Pro SP 3
Excel 2007 on Vista 64


.