ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro That Deletes Columns (https://www.excelbanter.com/excel-programming/349578-macro-deletes-columns.html)

Lilbit

Macro That Deletes Columns
 
I tried to record a macro that allows me to delete columns I don't need in
a report that I regularly generate from a program. Some of the columns
are noncontiguous. Everytime I record the macro, choose the columns to be
deleted, and go to Edit, Delete, I get the message, “That command cannot be
used with selections that contain entire row or columns, and also other
cells. Try selecting only entire row, entire columns, or just groups of
cells.” Is there a way around this? Thanks!!


Don Guillett

Macro That Deletes Columns
 
try
Range("b1, d1, g1").EntireColumn.Delete
--
Don Guillett
SalesAid Software

"Lilbit" wrote in message
lkaboutsoftware.com...
I tried to record a macro that allows me to delete columns I don't need in
a report that I regularly generate from a program. Some of the columns
are noncontiguous. Everytime I record the macro, choose the columns to be
deleted, and go to Edit, Delete, I get the message, “That command cannot
be
used with selections that contain entire row or columns, and also other
cells. Try selecting only entire row, entire columns, or just groups of
cells.” Is there a way around this? Thanks!!




Lilbit

Macro That Deletes Columns
 
Thank you very much!!!


Don Guillett

Macro That Deletes Columns
 
glad it helped


--
Don Guillett
SalesAid Software

"Lilbit" wrote in message
lkaboutsoftware.com...
Thank you very much!!!





All times are GMT +1. The time now is 09:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com