julesfromthb
11-10-2011, 05:20 PM
Hi! Please help with this problem: I have a sheet with five columns in col B I have cells with both text and numbers at varying intervals. I want to run a macro that will find each number then cut and paste it one row above and two columns over. Heres what I have:
Sub newtry()
Range("B2").Select
Dim testvar As Object
Set testvar = Range("B2")
Dim numericcheck As Boolean
numericcheck = IsNumeric(testvar)
Do Until IsEmpty(ActiveCell.Offset(0, 3))
If numericcheck = False Then
testvar.Select.Cut.Offset(-1, 2).Paste
ActiveCell.Offset(2, -2).Select
Else
ActiveCell.Offset(1, 0).Select
End If
Loop
End Sub
Sub newtry()
Range("B2").Select
Dim testvar As Object
Set testvar = Range("B2")
Dim numericcheck As Boolean
numericcheck = IsNumeric(testvar)
Do Until IsEmpty(ActiveCell.Offset(0, 3))
If numericcheck = False Then
testvar.Select.Cut.Offset(-1, 2).Paste
ActiveCell.Offset(2, -2).Select
Else
ActiveCell.Offset(1, 0).Select
End If
Loop
End Sub