Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

With VB, I need to know the RANGE of an Excel cell...

Status
Not open for further replies.

dicolas

Technical User
Joined
Oct 22, 2001
Messages
7
Location
CA
For example, If I dynamically fill a sheet, is there a way to know the range of the cell (29,20) (which normally is ("AC:20") ?????

Thanks a lot.
 
dicolas, I think you need the RefersTo... methods with the Name property.


Sub AnExample()
Range("A10:B11").Select
ActiveWorkbook.Names.Add Name:="ThisRange", RefersToR1C1:="=Sheet1!R79C3:R84C3"
Range("A1").Select
Range("ThisRange").Select
'I borrowed the following from the Help File...
p = Names("Print_Area").RefersToRange.Value
MsgBox "Print_Area: " & UBound(p, 1) & " rows, " & _
UBound(p, 2) & " columns"
End Sub

HTH,

CB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top