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
--
Gary
"Pierre via OfficeKB.com" <u13950@uwe wrote in message
news:58bbd2b0eb079@uwe...
Hi,
I have a sheet where the user is asked to put in columns A:F.
in column
A : number
B : Name
C : Date of birth
D : Salary
E : Parttime%
F : Hiredate
Now, what i want in columns G:P is to put in certain formulas.
Because i do not know how many employees (rows) are filled in by the user,
i
put my formulas in all cells ranging from G1:P5000.
This works ofcourse (unless the user puts in more than 5000 names) but the
applications becomes very slow due to all the calculations it does.
Is there a way to only put in the formulas in colums G:P when the user has
put something in columns A:F ?
In this case there would be only formulas on the rows that the user uses !
Any ideas how to program this ?
Thanks,
Pierre
--
Message posted via http://www.officekb.com