Macro to delete columns

L

Luong

Hello,

I have a macro to import text file data into an Excel
spreadsheet. Sometimes, several columns imported have
blank data and can be random columns. I would like to
write a macro to do the followings:
1) From column A-M, If any column along row cell 9 is
blank, then delete the entire columns with blank data.

Thanks for any help.
 
L

Laura Cook

Sub DeleteBlanks()
Range("A9:M9").SpecialCells(xlCellTypeBlanks).EntireColumn.Delete
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top