Hi all. I've created this simple code to help me move some data around. I'm trying to move data from Column C to Column D, E, F, etc when there is no text in a cell within Column B. See my code and example below.
<tbody>
</tbody>
After VBA formatting:
<tbody>
</tbody>
Sub Test()
Dim rownum As Long
Dim rowtext As Long
Dim colmnltr As Long
For rownum = 2 To 950
If IsEmpty(Range("B" & rownum)) Then
Range("C" & rownum).Select
Selection.Cut
colmnltr = colmnltr + 1
Range(Columns(colmnltr) & rowtext).Select
ActiveSheet.Paste
Else
rowtext = rownum
colmnltr = 3
End If
Next rownum
End Sub
Initial Data:
Name | Relationship | Immediate Family | NOK 1 | NOK 2 | NOK 3 |
FName LName | Father | Son - First Last | |||
Mother - XX | |||||
Father - XY | |||||
First Last | Brother | Mother - XX | |||
Father - XY |
<tbody>
</tbody>
After VBA formatting:
Name | Relationship | Immediate Family | NOK 1 | NOK 2 | NOK 3 |
FName LName | Father | Son - First Last | Mother - XX | Father - XY | |
First Last | Brother | Mother - XX | Father - XY | ||
<tbody>
</tbody>