![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 90
|
I need a technique to .Select a range of cells that are based on stored column and row values.
Range("A1:Z10).Select is a "hard coded method and does not fit my needs. I first position to the first cell and save the cell values using: StartRow = ActiveCell.Row StartCol = ActiveCell.Column then, locate end cell and similarly save: EndRow = ActiveCell.Row EndCol = ActiveCell.Column The results of save are: StarRow = 1 StartCol = 1 EndRow = 10 EndCol = 26 These values define the points of my cell range. How do I .Select this range? The following is close, but incomplete.... Range(Columns(SCol),Columns(ECol)).Select *********************************************
__________________
EMSS |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 2,908
|
Hi,
How about:- Range(Cells(startrow, startcol), Cells(endrow, endcol)).Select Hope it helps, D |
|
|
|
|
|
#3 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Portland, OR USA
Posts: 1,374
|
Quote:
Hope this helps, Russell |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|