Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default adjust range size??


I am using a data validation list defined as a range using =PartsList.
If the range was initially set up as A1:A10 and I change the rang
(delete the data in A4), is there some way in VBA that I can adjust th
size of the range to now be A1:A9 so that I can continue to use th
=PartsList for validation? Thanks

--
ricksim
-----------------------------------------------------------------------
ricksimm's Profile: http://www.excelforum.com/member.php...fo&userid=2189
View this thread: http://www.excelforum.com/showthread.php?threadid=38239

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default adjust range size??


PartsLists is a defined name.
to change what the name refers to use:

insert/ name/ define...

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


ricksimm wrote :


I am using a data validation list defined as a range using
=PartsList. If the range was initially set up as A1:A10 and I change
the range (delete the data in A4), is there some way in VBA that I
can adjust the size of the range to now be A1:A9 so that I can
continue to use the =PartsList for validation? Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default adjust range size??

you can define the PartsList name with this function (in
insert/name/define...):
=OFFSET(Sheet1!$A$1;0;0;COUNTA(Sheet2!$A:$A);1)
and it will automaticaly change its size depending on how many items
there are in the A column

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default adjust range size??

If the range is A1:A10, and you delete A4, you don't need to do anything,
Excel will automatically adjust it for you.

You get a problem where you change the data at the start or the end, adding
rows to either, as they will not automatically get included. This can easily
be addressed by using dynamic ranges, such as

OFFSET($A$1,0,0,COUNTA($A:$A)-1)

--
HTH

Bob Phillips

"ricksimm" wrote in
message ...

I am using a data validation list defined as a range using =PartsList.
If the range was initially set up as A1:A10 and I change the range
(delete the data in A4), is there some way in VBA that I can adjust the
size of the range to now be A1:A9 so that I can continue to use the
=PartsList for validation? Thanks.


--
ricksimm
------------------------------------------------------------------------
ricksimm's Profile:

http://www.excelforum.com/member.php...o&userid=21892
View this thread: http://www.excelforum.com/showthread...hreadid=382390



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I insert a ' } ' into excel so that I can adjust its size? Mike H Excel Discussion (Misc queries) 0 August 17th 07 01:49 AM
adjust automatically size margins bebert Excel Discussion (Misc queries) 0 February 26th 06 11:10 PM
How do I adjust the font size in a Combo Box? JessicaJ Excel Discussion (Misc queries) 1 October 25th 05 05:53 PM
Adjust the size of cells automatically Dajana Excel Discussion (Misc queries) 1 September 6th 05 02:56 PM
How would I adjust size for printing CynDel007 Excel Discussion (Misc queries) 1 August 12th 05 11:13 AM


All times are GMT +1. The time now is 10:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"