Solved

# begin row sequence on a different row number

Posted on 2012-08-20
317 Views
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
Question by:fordraiders

LVL 24

Accepted Solution

change:
.Formula = "=TEXT(ROW(A4),""00000"")"
to
.Formula = "=TEXT(ROW(A4)-3,""00000"")"
0

LVL 3

Author Closing Comment

pefect Thanks
0

## Featured Post

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…