Stop searching. Start learning and developing your excel skills.
Macro
VBA
Formula
Function
Shortcut
Tricks

» » VBA To Select Variable Columns

VBA To Select Variable Columns

June 03, 2017 |
This is also related to below queries:
  1. dynamic range excel vba
  2. excel vba dynamic range column
  3. excel macro dynamic range
  4. vba range with variable row number
  5. 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:
  1. Please change Columns("A:D") to your columns. Example: Columns("A:B") or Columns("A:Z")
  2. 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