View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Barb Reinhardt Barb Reinhardt is offline
external usenet poster
 
Posts: 3,355
Default Programmatically selecting first worksheet

I have a list of workbooks and I want to get some data off of the first
worksheet. I plan to open the file and use an indirect formula similar to
what I'm showing below:

Range("H" & i).Select
ActiveCell.FormulaR1C1 = "=""'""&RC1&""\[""&RC7&""]SHEET1'!"""
Range("I" & i).Select
ActiveCell.FormulaR1C1 = "=INDIRECT(RC[-1]&""$B$33"")"


UNFORTUNATELY, the first worksheet has different names in each workbook.
It's not SHEET1. How would I identify the sheetname and include it in my
formula?

Thanks,
Barb Reinhardt