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
Don't select columns to delete them, in fact you should rarely be selecting anything programmatically.
I suspect your columns are not next to each other so this will work.
Range("C:C,F:F,I:I").Delete
Notice .select and selection were chopped off and the code combined to one line instead of:
Range("C:C,F:F,I:I").select
Selection.Delete
You can just replace ActiveCell with the Range.
Range("C4:F10").EntireColumn.Delete
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With