PDA

View Full Version : DELETE COLUMS



Rob2015
08-09-2015, 03:47 PM
Good evening,

I'm having to export data daily and would like to know the vba code to delete columns, A, D, F, and G along with row #1 and merge the whole worksheet? Your help is greatly appreciated. I've attached the spreadsheet that I'm working with. VBA is awesome!!!: pray2:


Thanks in advance,
ROB

ashleyuk1984
08-09-2015, 04:53 PM
Hi,

Sub Macro1()
Range("A:A,D:D,F:G").Delete Shift:=xlToLeft
Rows(1).Delete Shift:=xlUp
End Sub

This will delete the columns and row 1.
Not sure what you mean by merge the whole worksheet?
There was no data on the spreadsheet to 'merge'... so, you'll have to clarify what you actually mean.

Rob2015
08-15-2015, 07:54 PM
Thank you so much for the help! I'm just starting VBA and have been going over a lot of literature (hrs and hrs) lol. The data was deleted from the sheet that I uploaded but you help a lot and code is working. Thanks again!