• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Formula FillDown By Vba

delta

Member
i like start formula fill down in column "C" from end xldown value to TextBox1 value
in my example TextBox1 value is 10 i.e. formula fill down 10 cells from "C"xldown cells
i attache image file and sample file

my macro is

Code:
Sub test()
Dim i As Integer
Dim lrow As Long


lrow = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row



Sheets("Sheet1").Range("A3").End(xlDown).Select
Range("A3").End(xlDown).Offset(0, 2).Value = 12000


For i = lrow To lrow + TextBox1.Value
Sheets("Sheet1").Range("C" & i).End(xlDown).Offset(1, 0).Value = Sheets("Sheet1").Range("C" & i - 1).End(xlDown).Value * (1 + 6 / 100)
Next i
End Sub
 

Attachments

  • Macro.JPG
    Macro.JPG
    51.8 KB · Views: 5
  • R_Plaaning.xlsm
    22.6 KB · Views: 4
Last edited by a moderator:
Modify test code like below and test.

Code:
Sub test()
Dim lngLastRow As Long: lngLastRow = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row
Dim lngInput As Long: lngInput = Me.TextBox1.Value
Range("C" & lngLastRow).Value = 120000
Range("C" & lngLastRow + 1).Resize(lngInput, 1).Formula = "=" & Range("C" & lngLastRow).AddressLocal(False, False) & "*(1+6/100)"
End Sub
 
According to the attachment as a beginner starter :​
Code:
Private Sub CommandButton1_Click()
    With [A3].End(xlDown)(1, 3)
        .CurrentRegion.Clear
        .Value2 = 120000
        .Offset(1).Resize(TextBox1.Value).Formula = "=" & .Address(0, 0) & "*(1+6/100)"
    End With
End Sub
Do you like it ? So thanks to click on bottom right Like !
 
Back
Top