Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Excel 2013 Row shift I am currently use Excel 2013 and I am trying to clean up d

ID: 638028 • Letter: E

Question

Excel 2013 Row shift

I am currently use Excel 2013 and I am trying to clean up data in a .csv file. Attached is a picture for reference. As you can see, column B contains both names and numbers. I want to shift every row that has a number in column B, starting with the number and going to the end of the row, one cell to the right. I know that I can simply cut and paste, but there are a lot of rows in this workbook so this would be very tedious. I want to know if there are features in Excel that allow me to do this, or if it can be done with a macro, what should the macro look like? I hope that I have explained my question well. Thank you for your time and help !!

Explanation / Answer

Hi..

Don't like that attempt.

Try this one.

Sub shiftover()
    For Each cell In Selection
    If Not IsEmpty(cell) And IsNumeric(cell) Then
            cell.Insert Shift:=xlToRight
        End If
    Next
End Sub

or

try this

Select column B then run this macro.

Sub shiftover()
    For Each cell In Selection
        If IsNumeric(cell) Then
            cell.Insert Shift:=xlToRight
        End If
    Next
End Sub