View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Variable range question

Two examples - which one you want depends on what gaps may exist in your
data. If it looks like this

1
2

3
4

x
x
x

and you wanted to select cells 1 through 4 (I'm assuming Column A, the x's
are the static rows I assume you want excluded) then:

Sub test()
With Sheets("Sheet1")
.Range("A1", .Cells(.Rows.Count, _
1).End(xlUp).End(xlUp).End(xlUp)).Select
End With
End Sub

Or, if there are no spaces in your data, you could start at the top and go
down, so

1
2
3
4

x
x
x


Sub Test2()
With Sheets("Sheet1")
.Range("A1", _
.Range("A1").End(xlDown)).Select
End With
End Sub

"papadoc" wrote:


i am attempting to copy a select range of cells that the bottom of the
range of cells changes from one sheet to several sheets. i also have
three cells that are static at the bottom of the colomn that do not
need to be copied. i know it is simple but for some reason i can't seem
to figure it out. any help would be greatly appericated.


--
papadoc
------------------------------------------------------------------------
papadoc's Profile: http://www.excelforum.com/member.php...o&userid=36463
View this thread: http://www.excelforum.com/showthread...hreadid=562268