ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Active Cell plus number of Rows (https://www.excelbanter.com/excel-programming/271624-re-active-cell-plus-number-rows.html)

Don Guillett[_4_]

Active Cell plus number of Rows
 
Something like this
Sub makerange()
Cells.Find("power").Select 'Address
foundyrow = Selection.Rows.Count
Selection.Resize(foundyrow + 240, 1).Select
End Sub


--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Amber" wrote in message
om...
Hi all!
I am a novice with xl macros and could use some help. I have data
that spans 240 rows in one column. I have done a cell find to access
the column I want and I want to select the next 240 rows in that
column. I keep getting a compiling error when trying to range and
select those 240 the cells. Here's what I have:

Cells.Find(What:="power", LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByColumns, MatchCase:= _
False).Activate
'these next two rows of programming are the problem
ActiveCell.Offset(1,0)
Range(ActiveCell, ActiveCell.Offset(240,0))

Can anyone help?
Thanks in advance





All times are GMT +1. The time now is 09:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com