Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default Dropd Down (validation: list) on the fly with a code - a problem

Hi,

I was hoping if anyone could help me - i'm trying to write a code that
would create a dropdown in a cell on the fly. That's the simple code:

With Selection.Validation
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
Operator:= _
xlBetween, Formula1:="1;2"
.InCellDropdown = True
End With

So far so good, but the problem is that i want the dropdown to let the
user enter either 1 or 2 but if i run the above code then the dropdown
lets the user enter only one value = "1;2".
In the meantime if i enter the same list ("1;2") manualy into the
validation (Datavalidation - i.e., don't do it with a code) - then
everything is fine - i.e., the dropdown offers either value ("1" or
"2") and not the combined ("1;2").

The point is that i'll need to define the dropdown lists on the fly
and they'll constantly change, that's why i wanted to do that with a
code.

Any help would be greatly appreciated.
Thanks!
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default Dropd Down (validation: list) on the fly with a code - a problem

It was so simple...!!
Perfect! THANKS!

I must start using "," as list seperators in my Regional settings, i
believe - otherwise i'll have confusions like this all the time...

Thanks again.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Dropd Down (validation: list) on the fly with a code - a problem

AB
I must start using "," as list seperators in my Regional settings, i
believe


There is no need for this, I have a semi-colon as list seperator in my
settings.
Just remember VBA has the US settings by design.

HTH
Cordially
Pascal

"AB" a écrit dans le message de news:
...
It was so simple...!!
Perfect! THANKS!

I must start using "," as list seperators in my Regional settings, i
believe - otherwise i'll have confusions like this all the time...

Thanks again.



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
VBA Code to read selection from a Validation List Greg J Excel Programming 2 November 29th 06 04:42 AM
VBA Code to read selection from a Validation List Greg J Excel Programming 0 November 29th 06 04:24 AM
Adding a validation list by code Philippe Pons Excel Programming 2 August 1st 05 04:25 PM
Problem with List Validation Cameron MacNeil Excel Programming 3 July 5th 05 09:37 PM
Validation list using code Gareth[_3_] Excel Programming 8 December 7th 03 12:13 AM


All times are GMT +1. The time now is 07:05 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"