What am I missing here?

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

Guest

Using the following code

Dim RngDate As Range
Set RngDate = ThisWorkbook.Worksheets("Summary Report").Range("A" & i)
ThisWorkbook.Worksheets("Summary Report").Range(RngDate).Select

Fails at line 3 with the following error:

Application Defined or object defined error.

Can anyone help me please?

Thanks.

Nick
 
RngDate is already a range--you don't need to, er, you can't wrap it inside
range().

application.goto rngdate, scroll:=true 'false?

should be sufficient.
 
You can't select a range of a range, if I'm making sense. I.E., you're
setting RngDate as a range, and then trying to use it in another range
statement. Either do (1) or (2)

1) simply select the range this way:
ThisWorkbook.Worksheets("Summary Report").Range("A" & i).Select

or 2) if cell "A?" has a valid range syntax in it e.g. "A1" contains the
string "B1"
ThisWorkbook.Worksheets("Summary Report").Range(Cells(i, "a").Value).Select
 
Remember that you can only select a range on a worksheet that's active.

You may need:

thisworkbook.activate
worksheets("summary report").select
rngdate.select

if you don't use application.goto.
 

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