Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 375
  • Last Modified:

begin row sequence on a different row number

excel 2010 vba


I have code that creates  a number sequence in column A

however I want to start the sequence  

"00001" in row 4 column A


Sub FillIt()

    Dim rng As Range

SetGeneralXsort



    With ActiveSheet
        Set rng = .[a4].Resize(997, 1)
    End With

    With rng
        .NumberFormat = "General"
        .Formula = "=TEXT(ROW(A4),""00000"")"
        .NumberFormat = "@"
        .Value = .Value
    End With

End Sub

Sub SetGeneralXsort()
'
'
    Range("A4:A997").Select
    Selection.NumberFormat = "General"
    Range("A4").Select
End Sub


Thanks
fordraiders
0
Fordraiders
Asked:
Fordraiders
1 Solution
 
SteveCommented:
change:
.Formula = "=TEXT(ROW(A4),""00000"")"
to
.Formula = "=TEXT(ROW(A4)-3,""00000"")"
0
 
FordraidersAuthor Commented:
pefect Thanks
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now