Hi All,

i could resolve the issue. the answer is as below (if anybody wants to know)

initially the scope for all the nameranges was WORKBOOK but wen i was 
increasing 
the range of namerange scope for few nameranges was becoming SHEET and 
therefore 
there were 2 nameranges with same name. 1 with worksheet scope and othr with 
workbook scope.

expansion of range was happening for namerange which has worksheet scope.but 
wen 
i was using that namerange in some other worksheet, it was considering 
namerange 
with workbook scope hence using OLD range.

SOLUTION:
what i did I simply delete the namerange before increasing it. so wen i delete 
it there is no nameange and wen i was adding the same namerange its scope was 
workbook and not the worksheet.

i hope this will help.




----- Original Message ----
> From: hanumant shinde <arsfan2...@yahoo.co.in>
> To: excel-macros@googlegroups.com
> Sent: Mon, 11 July, 2011 1:11:23 AM
> Subject: Re: $$Excel-Macros$$ Strange Issue with Macro
> 
> Hi,
> 
> i m increasing the range by code 
> 
> 
> 
> 
> ----- Original  Message ----
> > From: Rajan_Verma <rajanverma1...@gmail.com>
> >  To: excel-macros@googlegroups.com
> >  Sent: Sun, 10 July, 2011 9:25:24 PM
> > Subject: RE: $$Excel-Macros$$  Strange Issue with Macro
> > 
> > How Did u increase range  by code  or by name wizard?? Can you  attached
> > Sample File
> > 
> >  -----Original Message-----
> > From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com]
> >  On  Behalf Of Dilip Pandey
> > Sent: Saturday, July 09, 2011 5:55  PM
> > To: excel-macros@googlegroups.com
> >  Cc: arsfan2...@yahoo.co.in
> > Subject:  Re:  $$Excel-Macros$$ Strange Issue with Macro
> > 
> > Hi  Hanumant
> > 
> > It is  interesting..
> > I am assuming that  code first changes the range for the name  and then
> > the same is  getting used.  Try changing the order or  refresh
> > (Calculate)  the sheet.
> > If possible, share the test  file.
> > 
> > Best  Regards,
> > DILIPandey
> > 
> > On 7/9/11, hanumant shinde   <arsfan2...@yahoo.co.in>   wrote:
> > > Hi friends,
> > >
> > > i have a file in which  there are 2  sheets. sheet A and B. i am giving 
>name
> > > ranges in  sheet B as  below.
> > >
> > >
> > > A1:A20 -  "Range1"
> > > B1:B20 -  "Range2"
> > > C1:C20 -  "Range3"
> > > D1:D20 - "Range4"
> > > these name  ranges are  used in Sheer A.for data validation
> > > programatically i am   increasing these ranges by 10 rows
> > >
> > > A1:A30 -  "Range1"
> > >  B1:B30 - "Range2"
> > > C1:C30 -  "Range3"
> > > D1:D30 -  "Range4"
> > >
> > > after  increasing the ranges if i do  Range("Range1").Select for all  
>ranges
> > > then
> > > proper range is  getting selected  i.e. from 1 to 30. BUT when i used the
> > same
> > > range in   data validation then some of the ranges are using OLD values 
>i.e.
> >  >  lets
> > > say for data validation ranges used are like  below
> > >
> > >  A1:A30 - "Range1"  - Right
> >  > B1:B30 - "Range2"  - Right
> > >  C1:C20 - "Range3"   - Wrong
> > > D1:D20 - "Range4"  -  Wrong
> > >
> >  > can anybody please tell me why that would happen.
> > >  this  is very strange issue i saw my code is getting executed  for
> >  increasing
> > > the
> > > range and its working fine. but still i  m  facing his issue. ANY help 
>would
> > > help
> > > me a  lot.
> > >
> > >  thanks
> > >
> > >   --
> > >
> >  
----------------------------------------------------------------------------
> >  ------
> > >  Some important links for excel users:
> > > 1.  Follow us on TWITTER for tips  tricks and links :
> > > http://twitter.com/exceldailytip
> > > 2. Join our LinkedIN   group @ http://www.linkedin.com/groups?gid=1871310
> > > 3. Excel tutorials  at http://www.excel-macros.blogspot.com
> > > 4. Learn VBA Macros at http://www.quickvba.blogspot.com
> > > 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
> > >
> > > To post to this  group,  send email to excel-macros@googlegroups.com
> >  >
> > >  <><><><><><><><><><><><><><><><><><><><><><>
> >  > ; Like our page on facebook , Just follow below link
> > > http://www.facebook.com/discussexcel
> > >
> > 
> > 
> >  -- 
> > Thanks &  Regards,
> > 
> > DILIP KUMAR PANDEY,  mvp
> >         MBA,B.Com(Hons),BCA
> > Mobile: +91  9810929744
> > dilipan...@gmail.com
> > dilipan...@yahoo.com
> > New Delhi -  62,  India
> > 
> > -- 
> >  
----------------------------------------------------------------------------
> >  ------
> > Some  important links for excel users:
> > 1. Follow us  on TWITTER for tips tricks and  links :
> > http://twitter.com/exceldailytip
> > 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
> > 3. Excel tutorials at http://www.excel-macros.blogspot.com
> > 4. Learn VBA Macros at http://www.quickvba.blogspot.com
> > 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
> > 
> > To post to this group,  send email  to excel-macros@googlegroups.com
> > 
> >  <><><><><><><><><><><><><><><><><><><><><><>
> >  Like  our page on facebook , Just follow below link
> > http://www.facebook.com/discussexcel
> > 
> > -- 
>>----------------------------------------------------------------------------------
>-
> >-
> >  Some  important links for excel users:
> > 1. Follow us on TWITTER for  tips tricks and  links : 
> >http://twitter.com/exceldailytip
> > 2. Join our LinkedIN  group @ http://www.linkedin.com/groups?gid=1871310
> > 3. Excel tutorials at http://www.excel-macros.blogspot.com
> > 4. Learn VBA Macros at http://www.quickvba.blogspot.com
> > 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
> > 
> > To post to this group,  send email  to excel-macros@googlegroups.com
> > 
> >  <><><><><><><><><><><><><><><><><><><><><><>
> >  Like  our page on facebook , Just follow below link
> > http://www.facebook.com/discussexcel
> > 
> 
> -- 
>----------------------------------------------------------------------------------
>-
> Some  important links for excel users:
> 1. Follow us on TWITTER for tips tricks and  links : 
>http://twitter.com/exceldailytip
> 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
> 3. Excel tutorials at http://www.excel-macros.blogspot.com
> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
> 
> To post to this group, send email  to excel-macros@googlegroups.com
> 
> <><><><><><><><><><><><><><><><><><><><><><>
> Like  our page on facebook , Just follow below link
> http://www.facebook.com/discussexcel
> 

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to