Hi, I have a code which runs on column A, but i need the code to ignore column A and start working from column B.
Sub transpose_in_place()
Dim rw As Long, cl As Long
With ActiveSheet
For rw = .Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
For cl = .Cells(rw, Columns.Count).End(xlToLeft).Column To 3 Step -1
If Not IsEmpty(.Cells(rw, cl)) Then
.Rows(rw + 1).Insert
.Cells(rw + 1, 1) = .Cells(rw, 1).Value2
.Cells(rw + 1, 2) = .Cells(rw, cl).Value2
.Cells(rw, cl).Clear
End If
Next cl
Next rw
End With
End Sub
Sub transpose_in_place()
Dim rw As Long, cl As Long
With ActiveSheet
For rw = .Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
For cl = .Cells(rw, Columns.Count).End(xlToLeft).Column To 3 Step -1
If Not IsEmpty(.Cells(rw, cl)) Then
.Rows(rw + 1).Insert
.Cells(rw + 1, 1) = .Cells(rw, 1).Value2
.Cells(rw + 1, 2) = .Cells(rw, cl).Value2
.Cells(rw, cl).Clear
End If
Next cl
Next rw
End With
End Sub