Posted By: Anonymous
How is it possible to create a range in vba using the column number, rather than letter?
Below are two solutions to select the range A1.
Cells(1,1).Select '(row 1, column 1) Range("A1").Select
Also check out this link;
We strongly recommend that you use Range instead of Cells to work with
cells and groups of cells. It makes your sentences much clearer and
you are not forced to remember that column AE is column 31.
The only time that you will use Cells is when you want to select all
the cells of a worksheet. For example: Cells.Select To select all
cells and then empty all cells of values or formulas you will use:
"Cells" is particularly useful when setting ranges dynamically and
looping through ranges by using counters. Defining ranges using
letters as column numbers may be more transparent on the short run,
but it will also make your application more rigid since they are "hard
coded" representations – not dynamic.
Thanks to Kim Gysen