View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Another Simple Error - More Info

Jim,

You'll get this error if Power Units is not the active sheet. Try

With Worksheets("Power Units")
Set fillRange = .Range(.Cells(4, 1), .Cells(i, 48))
End With

Note the leading periods before 'Range' and 'Cells'.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com





"Jim Berglund" wrote in message
news:5n5Qd.388476$Xk.289660@pd7tw3no...
I also tried...

Set SourceRange = Worksheets("Power Units").Range("A3:AV3")
Set fillRange = Worksheets("Power Units").Range(Cells(4, 1),
Cells(i, 48))
SourceRange.AutoFill Destination:=fillRange

With an error in the middle line. Apparently I'm having problems
using a variable in the Range.

Jim