View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Cush Cush is offline
external usenet poster
 
Posts: 126
Default VBA Dynamic Selection


sub LastCellColM

Dim rngLastCell as Range
Dim MyRange as Range

Set rngLastCell = Range("M65536").End(xlUp)
Set MyRange = Range("A1", rngLastCell)

' do your thing

end sub



"AJMorgan591" wrote:


Hi all,

Long story short, is it possible in VBA to dynamically select cells in
the range (for example) A1:Mx where x = the last row that contains data
(i.e. non-blank cells). The blank cells (i.e. those cells after row x)
do contain formulas linked to other worksheets but if the relevant
cells in those other worksheets are blank then so too are these cells.

Thanks in advance :)


--
AJMorgan591
------------------------------------------------------------------------
AJMorgan591's Profile: http://www.excelforum.com/member.php...o&userid=27774
View this thread: http://www.excelforum.com/showthread...hreadid=473647