Hi, all:
I need to define a cell range which always starts with cell A3 and
have a known number of cells. For example, if I know the number of
cells to be included in this cell range is 5, the cell range will be
A3:A8. and if I know the number of cells to be included in this cell
range is 10, then the cell range will be A3:A13. I do not want to
exclude blank cells within the cell range.
Please advise,
Thanks
JW - 29 May 2008 18:35 GMT
> Hi, all:
>
[quoted text clipped - 8 lines]
>
> Thanks
Sub oneWay()
Dim num As Integer
num = 5
Range("A3").Resize(num + 1).Select
End Sub
George - 29 May 2008 18:53 GMT
JW:
Thanks.
Is there anyway I can insert this as a Name? Excel Menu Bar\Insert\Name
\Define
I appreciate
Per Jessen - 29 May 2008 19:20 GMT
Hi
Dim TargetRange As Range
Dim num As Integer
num = 5
set TargetRange=Range("A3").Resize(num + 1)
ActiveWorkbook.Names.Add Name:="MyName", RefersTo :=TargetRange
Regards,
Per
> JW:
>
[quoted text clipped - 4 lines]
>
> I appreciate
George - 29 May 2008 20:03 GMT
Jessen:
It is perfect. Thank you so much for your help!