View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
tony h[_107_] tony h[_107_] is offline
external usenet poster
 
Posts: 1
Default Defining Ranges using macros


not my preferred way but probably the easiest for you to implement

at the beginning of the subroutine put in

dim intTotalRows as integer
intTotalRows= 200


then where you have range("L1:P200") or similar replace with
range("L1:P" cstr(intTotalRows))

then all you need to do is change the number in the one line at the
top.

If you want to make it cleaverer instead of intTotalRows = 200 use
intTotalRows=InputBox("Enter Max Rows") note that this will cause an
error if a non-number is entered.

Does this help?


--
tony h
------------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074
View this thread: http://www.excelforum.com/showthread...hreadid=543115