View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Text to columns by format type???

This is a good start. For me, a few values were indented by spaces as well
as having an indent.

Sub fixdata()
Dim cell As Range
Dim i As Long
For Each cell In Selection
If cell.IndentLevel 0 Then
cell.Resize(1, cell.IndentLevel).Insert xlShiftToRight
cell.IndentLevel = 0
End If
Next
End Sub


--
Regards,
Tom Ogilvy

"Matt" wrote in message
oups.com...
Thanks for the feedback, but I think I did not explain it correctly.
From my understanding the macro above would 'Trim' the empty spaces.

But the data I have does not have excess spaces. The data is all in
one column but the hierarchical structure is shown by increasing indent
format. As in, when I click on format cells and go into alignment the
first order class has a left alignment ident value of 1 and the second
order data has left alignment indent value of 2...

here is the URL I am pulling data from and trying to capture the
hierarchy.
http://www.alanwood.net/pesticides/c...ecticides.html

thanks