Thread: range function
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default range function

Perhaps he means the first and last rows in ActiveSheet.UsedRange??

Sub rick()
Dim SheetStart As Long, SheetEnd As Long
Set r = ActiveSheet.UsedRange
SheetEnd = r.Rows.Count + r.Row - 1
SheetStart = r.Row
Range("A" & SheetStart & ":D" & SheetEnd).Select
End Sub

--
Gary''s Student - gsnu200827


"Rick Rothstein" wrote:

I'm not sure what your ultimate question is, but the range you asked about
appears to work fine (as long as you have assigned values to both SheetStart
and SheetEnd).

--
Rick (MVP - Excel)


"Rick" wrote in message
...
This example works Range("A3:F" & SheetEnd).Select...
How do I make this one work? Range("A" & SheetStart & ":D" &
SheetEnd).Select

The statement has to be as generic as possible.