hello, i need macro to find value in column A(level) (in next column are values too), after find this value, cut all data from this row and move right to defined offset.
eg line with level:
0 not move
1 not move
2 move right one position all data with this line
3 move right two position all data with this line
4 move right three position all data with this line
5 move right four position all data with this line
I have to make tree structure
my macro is:
Sub Macro1()
Dim x As Range
Do
Set x = Columns(1).Find("2*")
If x Is Nothing Then Exit Do
x.Select
Selection.Cut
ActiveCell.Offset(0, 1).Select
ActiveSheet.Paste
Loop
Do
Set x = Columns(1).Find("3*")
If x Is Nothing Then Exit Do
Selection.Cut
ActiveCell.Offset(0, 2).Select
ActiveSheet.Paste
Loop
Do
Set x = Columns(1).Find("4*")
If x Is Nothing Then Exit Do
x.Select
Selection.Cut
ActiveCell.Offset(0, 3).Select
ActiveSheet.Paste
Loop
Do
Set x = Columns(1).Find("5*")
If x Is Nothing Then Exit Do
x.Select
Selection.Cut
ActiveCell.Offset(0, 4).Select
ActiveSheet.Paste
Loop
End Sub
but move only one cell right (i need all data from line move right to define position)
please help
Bookmarks