Can I abbrevate the following (would I Dim and Set it as a Range?)

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

AccRep.Sheets("Volumes").Cells.Find("latest")

Rather than using this many times in the code I thought I could define
it as a Rng or Path or String or something?

Which would I use, whats the different between a Path and a String.

Thanks VBA (virtually beginner amateur)
 
hi, you can use Set to set a reference, e.g.

Dim rng as Range
Set rng = AccRep.Sheets("Volumes").Cells.find()
rng.offset(0,1)=1
rng.Offset(0,2)=2

rng must be a Range, a String won`t work.

stefan
 

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