refering to a workbook

  • Thread starter Thread starter Todd Htutenstine
  • Start date Start date
T

Todd Htutenstine

For Each rng In Range("D1:BO1").Cells

Above is my code. It refers to a range, but this range is
on another workbook which will be open. This code is
stored in a userform module on a seperate workbook so I
need to tell it where to look for the range on the
destination workbook.

The destination is...
Workbook: 2004 Renewals New.xls
Worksheet: Renewals WOW 2004

How would I put this is as the range?


Thank you
Todd Huttenstine
 
for each rng in Workbooks("2004 Renewals New.xls") _
.Worksheets("Renewals WOW 2004").Range("D1:BO1")

But you have posted such code previously - you can't make the connection?
 
I failed to put the "" around my workbook. It was turning
red. Tahnk you.
 
Workbooks("2004 Renewals New").Worksheets("Renewals WOW 2004").Range...

I don't believe the ".xls" is necessary, but I could be wrong.
Otherwise this should be right on... - Piku
 
using the .xls always works. If you don't use it it may work depending on
settings the user has chosen in folder options.
 
In that case, it would have been better to have posted the 'bad' code and
asked what was wrong with it. Always ask the question directly, it makes it
easier for us.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top