I have a worksheet with ~700 rows, and 7 columns. I need each row to have just one entry. I.e. if row 1 has cell values in column A,B and C, then two new rows should be created so row 1 has one value in column A, row 2 has one value in column B and row 3 has one value in column C.
I have spent a couple hours on this (sadly) but I'm so bad, I'm not getting anywhere:
Sub TThis()
Dim rng As Range
Dim row As Range
Dim cell As Range
'just testing with a basic range
Set rng = Range("A1:C2")
For Each row In rng.Rows
For Each cell In row.Cells
If cell.Value <> "" Then
'write to adjacent cell
Set nextcell = cell.Offset(1, 0)
nextcell.Value = cell.Value
nextcell.EntireRow.Insert
End If
Next cell
Next row
End Sub
My issue is that this code deletes the row beneath it (which is not suppose to happen) and it inserts two rows instead of one.
Thanks a ton!