View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Pierre via OfficeKB.com[_2_] Pierre via OfficeKB.com[_2_] is offline
external usenet poster
 
Posts: 122
Default problem formulas

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