Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Automatic Indenting (2003)

    Greetings,

    Well, not sure if this can be done, but here goes. I have a need where the data I import needs to have some of the data Indented for readability.

    Basically, I need to indent the numerical information in Column A. I have attached a file, with explainations in the file.

    This might be a toughie...

    Thanks for any thoughts....
    Brad
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Automatic Indenting (2003)

    Try this macro:
    <code>
    Sub Indent()
    Dim r As Long
    Dim m As Long
    m = Range("A" & Rows.Count).End(xlUp).Row
    For r = 1 To m
    If Not Range("A" & r) = "" Then
    If IsNumeric(Range("A" & r)) Then
    With Range("A" & r)
    .HorizontalAlignment = xlLeft
    .IndentLevel = .Value - 1
    End With
    End If
    End If
    Next r
    End Sub</code>

  3. #3
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatic Indenting (2003)

    Absolutly, positively, the best. Just made my week!!!!

    took forever to try to understand the data, now it is very clear. Had a file of 22000 lines, and it took ~ 1 min to process. Not it is completly readable.


    I hoist one to ya!


    Thanks
    BRad

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •