Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
BB BB is offline
external usenet poster
 
Posts: 39
Default VBA newbie needs a little help

I have three comboboxes, the last two dependent, which appear when i double
click into a cell with a data validation list.

The code that I have shows

str = "=" & Target.Offset(0, -1).Value

for the listfillrange (listfillrange=str) for the two dependent lists. The
problem with this is that I named my two word ranges as one word, e.g.
NewYork, which came up fine in the data validation list which uses

=indirect(substitute(A1," ","")

However, the combo box does not pick up the listfillrange for the dependent
list if the one that it depends on has two words, because the name of the
list range is all one word.

Is there any way for me to tell it str needs to equal the value of the cell
to its left, as it is doing now, but to disregard spaces in that cell, as the
substitution formula was doing in my data validation list.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default VBA newbie needs a little help

Not totally sure I get the question, but I will take a pot.

str = "=" & Replace(Target.Offset(0, -1).Value," ","")


--

HTH

RP
(remove nothere from the email address if mailing direct)


"BB" wrote in message
...
I have three comboboxes, the last two dependent, which appear when i

double
click into a cell with a data validation list.

The code that I have shows

str = "=" & Target.Offset(0, -1).Value

for the listfillrange (listfillrange=str) for the two dependent lists. The
problem with this is that I named my two word ranges as one word, e.g.
NewYork, which came up fine in the data validation list which uses

=indirect(substitute(A1," ","")

However, the combo box does not pick up the listfillrange for the

dependent
list if the one that it depends on has two words, because the name of the
list range is all one word.

Is there any way for me to tell it str needs to equal the value of the

cell
to its left, as it is doing now, but to disregard spaces in that cell, as

the
substitution formula was doing in my data validation list.



  #3   Report Post  
Posted to microsoft.public.excel.programming
BB BB is offline
external usenet poster
 
Posts: 39
Default VBA newbie needs a little help

Bob-

you got the question and then some. Worked perfectly! Thanks for the speedy
reply.

"Bob Phillips" wrote:

Not totally sure I get the question, but I will take a pot.

str = "=" & Replace(Target.Offset(0, -1).Value," ","")


--

HTH

RP
(remove nothere from the email address if mailing direct)


"BB" wrote in message
...
I have three comboboxes, the last two dependent, which appear when i

double
click into a cell with a data validation list.

The code that I have shows

str = "=" & Target.Offset(0, -1).Value

for the listfillrange (listfillrange=str) for the two dependent lists. The
problem with this is that I named my two word ranges as one word, e.g.
NewYork, which came up fine in the data validation list which uses

=indirect(substitute(A1," ","")

However, the combo box does not pick up the listfillrange for the

dependent
list if the one that it depends on has two words, because the name of the
list range is all one word.

Is there any way for me to tell it str needs to equal the value of the

cell
to its left, as it is doing now, but to disregard spaces in that cell, as

the
substitution formula was doing in my data validation list.




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
Real Newbie newbie question Dave New Users to Excel 0 January 10th 07 07:55 PM
Newbie Help. Is this possible? taltos1 Excel Discussion (Misc queries) 5 November 12th 05 04:40 PM
newbie needs help... Dave[_48_] Excel Programming 4 October 21st 04 07:08 PM
Newbie John[_66_] Excel Programming 2 November 28th 03 02:10 PM
Newbie needs help MarkJones Excel Programming 5 November 27th 03 02:47 PM


All times are GMT +1. The time now is 07:31 PM.

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

About Us

"It's about Microsoft Excel"