![]() |
![]() |
|
|||||||
| 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: May 2002
Location: Cornwall,England
Posts: 1,273
|
Hi Guys
I'm trying to select a whole row, based on a value in a cell. e.g. if the cell's value is 6, I want to select row 8, cell value 7, select row 9 etc etc. It's simple I know, but driving me bonkers Sykes _________________ ....and the meek shall inherit the earth... (but not the mineral rights!) [ This Message was edited by: sykes on 2002-05-24 07:56 ] |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Apr 2002
Location: Greenwood, SC
Posts: 677
|
Assuming the selected row is always the input value + 2, this would work:
If the row to select is something different, you could use a select case construct. K [ This Message was edited by: kkknie on 2002-05-24 06:52 ] |
|
|
|
|
|
#3 |
|
MrExcel MVP, Administrator
Join Date: Feb 2002
Location: The act or process of locating.
Posts: 13,679
|
Although kkknie's may be better for what you're trying to do... _________________ ~*Kristy*~ "Catapultam habeo. Nisi pecuniam omnem mihi dabis, ad caput tuum saxum immane mittam." [ This Message was edited by: Von Pookie on 2002-05-24 06:53 ] |
|
|
|
|
|
#4 |
|
Join Date: May 2002
Posts: 73
|
Or just one line of code :-
Rows(ActiveCell.Value + 2).Select |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: May 2002
Location: Cornwall,England
Posts: 1,273
|
You're far too clever for your own good.....all three of you!!
Many thanks, as always Sykes
__________________
Sykes Vista / Xl2007 |
|
|
|
|
|
#6 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
BTW, a non-macro solution would be to define a Named range (e.g., Sheet1!row) as refers to...
=OFFSET(Sheet1!$A$1,Sheet1!$A$1+1,,1,255) Now you can enter 6 into cell A1, press Control+G, and enter "row" as the Go To Reference and press [ Enter ]. [ This Message was edited by: Mark W. on 2002-05-24 11:05 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|