I’ve been working on simplifying a script, I wanted to create a script that would copy within a range of columns over to the furthest left unoccupied column. Then delete the original column.
I’ve tweaked this script I found to do mostly what I wanted, it copies everything over, but doesn’t delete.
I also need it to make it so that it can choose which row in said column range to look at for reference.
Could someone take a look at the script and help finish what I’ve started? I’ve been learning Excel VBA slowly, and my work has caused me to jump ahead in multiple directions before I have been ready, so I know that the copy and delete options should be simple, but because of the my line of work, I haven’t had the time to learn everything correctly, so sorry if this is a simple answer, but I need to keep this script as lean as possible, and this is what I’ve come up with so far with what I know and scoured the internet for code and help.
Option Explicit
Sub MoveColumns()
Dim cel As Range
With ActiveSheet
For Each cel In Intersect(.UsedRange, .[B:N]).SpecialCells(xlCellTypeBlanks).Cells
cel = cel.Offset(0, 1)
Next
End With
End Sub
Thanks in advance.
What you want is complicated way of moving things. The easiest way is to delete the blank column. The rest of the columns will automatically move to the left 🙂 I am assuming that there is no data after row 194.
Try this
HTH