![]() |
![]() |
|
|||||||
| 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 |
|
New Member
Join Date: Mar 2002
Posts: 2
|
Hi,
I need help on a macro that selects and copies a range of cells that go from A3 to H?? (the final row depends on the number of entries) I have the reference to the H?? cell in "K7" , but I can't make a macro to reference that address, I'm only getting the K7 reference. How do I make the macro select the address that I have in K7? Is it possible or do I have to approach the problem from another angle? Thanks, Nelson |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Stockton, California
Posts: 281
|
Define k7 as a variable in your macro like this:
Sub select_range() selectend = Range("K7").Value Range("A3:" & selectend).Select End Sub [ This Message was edited by: robfo0 on 2002-04-08 16:54 ] |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: San Francisco, California USA
Posts: 10,388
|
Just wondering why you place the last row into K7? How about eliminating that step and using the line of code such as
Range([A3], [H65536].End(xlUp)).Select Unless there's something else going on with your spreadsheet, this might be a way to go. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|