rows........again (resolved - thank God!)

sykes

Well-known Member
Joined
May 1, 2002
Messages
1,885
Office Version
  1. 365
Platform
  1. Windows
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
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Assuming the selected row is always the input value + 2, this would work:<PRE>
Dim iInput As Integer

iInput = Sheets("Sheet1").Range("A1").Value

Cells(iInput + 2, 1).EntireRow.Select</PRE>

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
 
Upvote 0
<pre>
Sub SelectRows()

If Range("A1") = "6" Then
Rows("8:8").Select
ElseIf Range("A1") = "7" Then
Rows("9:9").Select
End If
End Sub</pre>






Although kkknie's may be better for what you're trying to do...


_________________<font color=red>~*</font><font color=blue>Kristy</font><font color=red>*~</font>

"Catapultam habeo. Nisi pecuniam omnem mihi dabis, ad caput tuum saxum immane mittam."

WebX
</img>
This message was edited by Von Pookie on 2002-05-24 06:53
 
Upvote 0
You're far too clever for your own good.....all three of you!!

Many thanks, as always

Sykes
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,225,040
Messages
6,182,539
Members
453,125
Latest member
SandwichTaker

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top