![]() |
![]() |
|
|||||||
| 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: Apr 2002
Posts: 5
|
I need to return the row number in a range to a variable. For Example: I have a vertical range named "WallA". It is 25 rows in one column: B19:b43. I need the row number returned. If B19 is selected then I need 1 returned. If B30 is selected then I need 12 returned. So far this is the code I have:
If ActiveCell.Text = "HWT" Or ActiveCell.Text = "HWA" Then Wid = Application.InputBox("Please enter the width for this HVAC Window", "HVAC Window Width", Type:=1) Cellnum = ActiveCell.Range("WallA").Rows.Count Worksheets("Formulas").Range("ValuesWallA").Row(Cellnum).Value = Wid Right now Cellnum = Activecell.range("WallA").rows.count always returns 25 I select cell B41 and the following returns 59 If I change it to Cellnum = Activecell.range("WallA").row My ultimate goal is to place the returned value from the input box into another 25 row range in the same row that the above returns. Any help would be appreciated. Thanks, Keith |
|
|
|
|
|
#2 |
|
Join Date: May 2002
Posts: 26
|
Cellnum = Activecell.Row-18
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|