Revisiting "New issue with "With" statment" post from 6/7/07

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Bob and all,

I tried this both ways you listed below and I'm getting "Run-Time error
'1004'" both ways...any thoughts on why this is coming up?
 
Take a look at this section of code:

With Sheets("Member ID Report Master")
Debug.Print F.Address
memberid = F.Offset(0, -3).Value
merchantid = F.Offset(0, -2).Value
membername = F.Offset(0, -1).Value

'Set memberid = .Range(F.Address()).Offset(0, -3).Value
' Set merchantid = .Range(.F.Address()).Offset(0, -2).Value
' Set membername = .Range(.F.Address()).Offset(0, -1).Value
End With

F.address when I run it is A2. The error is occurring because you are
using the offset to try to go to a cell that is 3 columns to the left of A2
which doesn't exist.

HTH,
Barb Reinhardt
 

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