This is also related to below queries:
- dynamic range excel vba
- excel vba dynamic range column
- excel macro dynamic range
- vba range with variable row number
- excel vba select range with variable number of rows
The Code:
Columns("A:D").Select
''' To select whole column A until column D
Range("X:X,AB:AB").Select
''' To select column X and column AB only
Note:
- Please change Columns("A:D") to your columns. Example: Columns("A:B") or Columns("A:Z")
- Please change Range("X:X,AB:AB") to your columns. Example: Range("A:A,C:C,AA:AB"). You may add more columns by just adding a comma before and after a column/ columns range
No comments:
Post a Comment