PDA

View Full Version : Select and delete entire columns



Ramo964516
02-28-2016, 01:09 PM
Hi everybody,

I have a range activated
Range(strPlageSélectionnée).Activate

, and i'm looking for selecting their entire columns in order to delete them. I know that to select a column there is a specific formula
ActiveCell.EntireColumn.Select

and to delete one column it's
ActiveCell.EntireColumn.Delete

But how can i select and delete many columns at once. Is there any specific formula ?

Thanks for your help
15493154941549515496

Paul_Hossler
02-28-2016, 03:24 PM
Maybe


Selection.EntireColumn.Delete

Ramo964516
02-29-2016, 03:49 AM
Hi Paul_Hossler,
I used
Range(strPlageSélectionnée).EntireColumn.Delete and it works. thanks for your help

williedog
03-03-2016, 08:19 AM
Hello Ramo964516,

Alternatively, if you want to delete contiguous ranges based on a single selected cell, such as G1 for example, you can do this -


Range(strPlageSélectionnée).Resize(, 2).EntireColumn.Delete ' change 2 to any number of contiguous columns

Hope that helps!