Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have tried various combinations to try and get this to work to no avail. It is only to fun on those worksheets between the 'First' worksheet and 'Last" worksheet. What is wrong with my code? I'm getting a 'Select method of range class failed'. Sub AutofillFormula() Dim ws As Worksheet Dim FirstIndex As Long Dim LastIndex As Long FirstIndex = Firstpg.Index LastIndex = Lastpg.Index For Each ws In ThisWorkbook.Worksheets If ws.Index FirstIndex Then If ws.Index < LastIndex Then ws.Range("N49").Select Selection.AutoFill Destination:=Range("N49:N349"), Type:=xlFillDefault ws.Range("N49:N349").Select End If End If Next ws End Sub -- Thanks for your help. Karen53 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Autofill | Excel Programming | |||
Autofill: Need to autofill one week block, (5) weekday only into cells. | Excel Discussion (Misc queries) | |||
Autofill | Excel Programming | |||
Help With Autofill | Excel Programming | |||
Q. Autofill question: Can I autofill alpha characters like I can numbers? | Excel Programming |