View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ardy Ardy is offline
external usenet poster
 
Posts: 136
Default Error Auto Fill Method of Range Class Failed

JLGWhiz:
Writting it like ("$C$3:$AH$3") did work. I am bit confused, why is
it that in some instances writting the cell designation as C3 dosen't
work but in other instances writting it as $C$3 works what is the
diffrence.

Ardy
JLGWhiz wrote:
That should have been:

Set SourceRange = Range("$C$3:$AH$3")

"Ardy" wrote:

Hello All:
I have been using this code in one other part of my spreadsheet which
has same conditions and it works for some reason when I use this in
another part of my spreadsheet it is giving me an error." Auto Fill
Method of Range Class Failed". I am a bit confused as to why this
works in one area and not in the other. The conditions are the same;
even the formula is the same different range but the same.
----------------------------------
Sub TransferPa_dwrInfo()
' Transfer information from student tab to PA-DWR Detail Tab
' Ardy 1-10-2007

Dim LastRow As Long

' InsertInfoTransferFormula_1 ' Insert the formula for transfer for the
firsr row(Module 1)
' This places the Formula on the first row C3:AH3. The formula is
'ActiveCell.FormulaR1C1 = "=INDIRECT(""'""&RC[-2]&""'!C24"")"
'This by itself works

With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range("C3:AH44").AutoFill Destination:=.Range("C3:AH" & LastRow), _
Type:=xlFillDefault
End With
End Sub
--------------------------------------