Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a body of text four columns wide and over 3000 rows deep. I have
formatted it into the shape of an outline and now have to enumerate each row of text according to its place in the outline like so... E.g. 1.0 Text 1.1 Text 1.1.1 Text 1.1.1.1 Text 2.0 Text etc... I was wondering if there is a macro I could set up so as to skip the manual outlining of the entire worksheet. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this.
this will number as shown your info spread across the columns Dim I As Integer Dim J As Integer Dim sect As Double Dim secdiv As String sect = 0 For I = 1 To 300 For J = 1 To 10 If Cells(I, J).Value < vbNullString Then If J = 1 Then secdiv = "" sect = sect + 1 Cells(I, J).Value = sect & ".0 " & Cells(I, J).Value Else secdiv = secdiv & "." & sect Cells(I, J).Value = sect & secdiv & " " & Cells(I, J).Value End If Else End If Next J Next I End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
how to count/sum by function/macro to get the number of record to do copy/paste in macro | Excel Programming | |||
macro to delete entire rows when column A is blank ...a quick macro | Excel Programming | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |