LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Problem with Autofill Macro

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with autofill [email protected] Excel Discussion (Misc queries) 2 September 8th 07 12:15 PM
Autofill Problem Lizzy Excel Discussion (Misc queries) 5 March 20th 07 01:47 PM
Autofill problem Teethless mama Excel Discussion (Misc queries) 0 November 30th 06 02:53 AM
Autofill problem Trout Excel Discussion (Misc queries) 0 November 30th 06 12:19 AM
Autofill problem dickives Excel Worksheet Functions 1 January 16th 06 10:35 PM


All times are GMT +1. The time now is 09:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"