![]() |
![]() |
|
|||||||
| 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: Feb 2002
Location: Tulsa, OK
Posts: 354
|
I am trying to write a macro to select I particular range that is below two lists. So the First part of the Macro is this:
Range("A1").Select ‘Bring me to end of 1st list Selection.End(xlDown).Select ‘Bring me to start of 2nd list Selection.End(xlDown).Select ‘Bring me to end of 2nd list Selection.End(xlDown).Select ‘Bring me to start of 3rd list Selection.End(xlDown).Select ‘Select Upper-Left Corner of List ActiveCell.Select ??? – How can I name the active cell as UpperLeft? UpperLeft = ActiveCell??? Range("UpperLeft", Range("B65536").End(xlUp).Address).Select I don’t know how to get that ??? part? Is it Dim UpperLeft As Range?String?Cell? |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
Try this code:
UpperLeft = ActiveCell.Address Range(UpperLeft, Range("B65536").End(xlUp).Address).Select Hope it helps. Kind regards, Al. |
|
|
|
|
|
#3 |
|
New Member
Join Date: Mar 2002
Posts: 2
|
Dim UpperLeft As Range
Set UpperLeft = ActiveCell Range(UpperLeft, [B65536].End(xlUp)).Select Your whole code could be re-written as follows (to avoid all that selecting) :- Dim UpperLeft As Range Set UpperLeft = [A1].End(xlDown).End(xlDown).End(xlDown).End(xlDown) Range(UpperLeft, [B65536].End(xlUp)).Select |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|