Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a macro which copies down formula so they are always 100 more than
the current no. of entries. This code is activated when the worksheet is activated. However i get an error with the line " Selection.AutoFill Destination:=Range(Left & ":" & RightFill), Type:=xlFillDefault " My code is below can anyone help? Thank you. Private Sub Worksheet_Activate() 'Define Varaibles Dim nr As Integer Dim Left As String Dim Right As String Dim RightFill As String Dim RowSelect As String Dim RowFill As String 'Set Varaibles nr = Application.CountA(Range("B:B")) + 2 Left = "K" & nr Right = "N" & nr RightFill = "K" & nr + 100 RowSelect = Left & ":" & Right RowFill = Left & ":" & RightFill 'Autofill Range(RowSelect).Select Selection.AutoFill Destination:=Range(Left & ":" & RightFill), Type:=xlFillDefault Range("B4").Select End Sub -- Cheers, Ben Remove your.tonsils to reply "You only live once but if you do it right once is enough!" |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem with autofill | Excel Discussion (Misc queries) | |||
Autofill Problem | Excel Discussion (Misc queries) | |||
Autofill problem | Excel Discussion (Misc queries) | |||
Autofill problem | Excel Discussion (Misc queries) | |||
Autofill problem | Excel Worksheet Functions |