CaptainGravyBum
Board Regular
- Joined
- Dec 1, 2023
- Messages
- 77
- Office Version
- 365
- Platform
- Windows
Hello,
I'm hoping this isn't a stupid question, but it's confusing the pants off me.
I recorded a macro to select certain columns and delete them, pretty simple right? should be fine.
Sub Macro1()
Columns("B:B").Select
Selection.Delete Shift:=xlToLeft
Columns("E:E").Select
Selection.Delete Shift:=xlToLeft
End Sub
Works ok if I do it myself, but if I run the macro it either selects the entire table or multiple columns. The only thing I can think is that there are some merged cells in the sheet which are overriding which columns are selected.
Does my theory sound correct and how can I get around the problem?
Thanks,
I'm hoping this isn't a stupid question, but it's confusing the pants off me.
I recorded a macro to select certain columns and delete them, pretty simple right? should be fine.
Sub Macro1()
Columns("B:B").Select
Selection.Delete Shift:=xlToLeft
Columns("E:E").Select
Selection.Delete Shift:=xlToLeft
End Sub
Works ok if I do it myself, but if I run the macro it either selects the entire table or multiple columns. The only thing I can think is that there are some merged cells in the sheet which are overriding which columns are selected.
Does my theory sound correct and how can I get around the problem?
Thanks,