Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2008

Tip: Looking for answers? Try searching our database.

cell range

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
George - 29 May 2008 18:25 GMT
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!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.