View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Peter Chatterton[_3_] Peter Chatterton[_3_] is offline
external usenet poster
 
Posts: 3
Default macro can't form a Range on an inactive Worksheet

You're right, here's the code:

Dim rNewRange As Range
Set rNewRange = ActiveWorkbook.Sheets(sInSheet). _
Range(Cells(1, 2), Cells(5, 6))
Set rNewRange = ActiveWorkbook.Sheets(sOutSheet). _
Range(Cells(1, 2), Cells(5, 6))

One or the other works depending on what worksheet
I'm starting the macro from.

It gives a 1004, "appl-def'd or obj-def'd error".