formula to auto-fill data

asma410

New Member
Joined
Feb 1, 2005
Messages
35
Hello,
I want to know if there is any formula/method I can use in my spreadhseet that will automatically fill a column. Example, I type '1' in cell A1 & it automatically fills the (increment) values 2, 3, 4, ..... say upto 3000 in that column. I dont want to drag the values upto cell A3000 to fill the series. My last choice would be to use VBA but I was wondering if there is a direct way to do it on the spreadsheet without any Vb code.

Thanks.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I think you must enter following formula into A2 cell and fill it till A3000. You do it once - works forever. :)

Code:
=A1+1
 
Last edited:
Upvote 0
Try dragging down the following formula from A2:


Code:
=$A$1*row()

This will then work if you wanted 2,4,6,8...etc as well...

:)
 
Upvote 0
Thanks for the replies. I am trying to avoid dragging down or selecting the cells (even once) all the way to A3000. Is there a series fill function that will allow me to set a range (A1:A3000) in a formula & the data fills down automatically without dragging it down to A3000?
 
Upvote 0
Insert the following to ThisWorkbook module:
Code:
Private Sub Workbook_Activate()
    Call AddShortCut
End Sub

Private Sub Workbook_Deactivate()
    Call DeleteAllMenus
End Sub

Insert the following to any standard module:
Code:
Sub AddShortCut()
    
    Dim cbr           As CommandBar
    Dim ctl           As CommandBarControl
    Dim iIndex        As Integer
    
    Set cbr = CommandBars("Cell")
    iIndex = cbr.Controls("Cut").index
    
    Set ctl = cbr.Controls.Add(Type:=msoControlButton, Before:=iIndex)
    
    With ctl
        .Caption = "Auto Fill"
        .BeginGroup = True
        .FaceId = 135
        .OnAction = "'FillDigits Selection'"
    End With

End Sub

Sub DeleteAllMenus()
    
    Dim cbr As CommandBar
    
    On Error Resume Next
    Set cbr = CommandBars("Cell")
    cbr.Controls("Auto Fill").Delete
    
    Set cbr = Nothing
    
End Sub

Sub FillDigits(rng As Range)
    rng.Offset(1, 0).Resize(4000, 1).FormulaR1C1 = "=R[-1]C+1"
End Sub

Enter any digit into cell (say, A1) and right-click it. At the top of shortcut menu you'll see "Auto Fill" button. Press it and enjoy. :)
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,738
Members
452,940
Latest member
Lawrenceiow

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top