View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Brad[_26_] Brad[_26_] is offline
external usenet poster
 
Posts: 10
Default Including tab name in absolute reference

Joel H,

Thank you for your help. It gave me what I was looking for.

Sorry for the confusion with the terminology. Yes, when I said tab I meant
sheet and when I said spreadsheet I meant workbook. I will try to be
clearer in the future. While looping and including the workbook names would
reduce the number of times I need to run the macros, it would take longer to
code in the looping than to just manually select the workbook and run the
macro 12 to 15 times.

I use Outlook Express to access the discussion group, so I do not see how to
check the "YES" option from here.

Thank you again. It was helpful.

Brad

Excel 2002 on XP Pro SP 3
Excel 2007 on Vista 64
"Ryan H" wrote in message
...
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


.