View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default problem formulas

Sub formules_vullen()
Dim lastrow As Long

lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Range("W4").AutoFill Destination:=Range("W4:W" & lastrow),
Type:=xlFillDefault
End Sub

--
Regards,
Tom Ogilvy

"Pierre via OfficeKB.com" <u13950@uwe wrote in message
news:58bc2a440d3a5@uwe...
Hi Gary,

I adapted your code to the following:

Sub formules_vullen()
Dim lastrow As Long

lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Range("W4").AutoFill Destination:=Range("W" & lastrow),

Type:=xlFillDefault
End Sub

I wanted to try filling column W with the value in W4 but it did not

work...
But it does not work. I get the message :

error 1004
Method Autofill of class range

Any ideas?
Thanks,
Pierre


Gary Keramidas wrote:
see if this works for you

Sub fill()

Dim lastrow As Long

lastrow = Worksheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row
Range("G1:p1").AutoFill Destination:=Range("G1:P" & lastrow),
Type:=xlFillDefault

End Sub

Hi,

[quoted text clipped - 22 lines]
Thanks,
Pierre


--
Message posted via http://www.officekb.com