Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
TBD TBD is offline
external usenet poster
 
Posts: 41
Default Trouble with Validation formula1:=Join(... Is '!' a reserved cha

Greetings,
I've written this question twice, and was about to abort it for the
second time, but will post it for comments, even though the problem may be
solved.

Note that below, the first string element of gNameAbbrs() had a leading '!'
(exclamation mark), and removing it _seems_ to have made a difference!(?)

(the original question)
I don't understand why the the code below doesn't work. After it
executes, the affected cell does not allow for a pull-down list - even though
the list DOES appear in Data\Validation dialog for the cell! Excel (2002)
also starts acting strange and will no longer quit via File\Exit Or the
window-close button - in either case a pop-up dialog announces that Excel
can't be exited. Killing Excel via TaskMgr is effective.

I've quintuple-checked the gNameAbbrs array (of Strings) is correctly
populated, again, the values ARE showing-up in Data\Validation UI.

Code:
           rRange.Select
           With Selection.Validation
             .Delete
             .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, 
Operator:= _
               xlBetween, Formula1:=Join(gNameAbbrs, ",") 'this isn't working
              'xlBetween , Formula1:="a,b,c" 'this works
             .InCellDropdown = True
             .InputMessage = ""
           End With
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Trouble with Validation formula1:=Join(... Is '!' a reserved cha

Hi

I tried to run the code below in both excel 2000 and 2007, with no errors.
Have you tried to move your code to a new workbook, to test if it also
happens there. Maybe your current workbook is somehow corrupted!

Sub test()
Dim MyArr(0 To 15) As String
For c = 0 To 15
MyArr(c) = "! A" & c
Next
MyString = Join(MyArr, ",")
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=Join(MyArr, ",") 'this isn't working
'xlBetween , Formula1:="a,b,c" 'this works
.InCellDropdown = True
.InputMessage = ""
End With
End Sub

Regards,
Per

"tbd" skrev i meddelelsen
...
Greetings,
I've written this question twice, and was about to abort it for the
second time, but will post it for comments, even though the problem may be
solved.

Note that below, the first string element of gNameAbbrs() had a leading
'!'
(exclamation mark), and removing it _seems_ to have made a difference!(?)

(the original question)
I don't understand why the the code below doesn't work. After it
executes, the affected cell does not allow for a pull-down list - even
though
the list DOES appear in Data\Validation dialog for the cell! Excel (2002)
also starts acting strange and will no longer quit via File\Exit Or the
window-close button - in either case a pop-up dialog announces that Excel
can't be exited. Killing Excel via TaskMgr is effective.

I've quintuple-checked the gNameAbbrs array (of Strings) is correctly
populated, again, the values ARE showing-up in Data\Validation UI.

Code:
           rRange.Select
           With Selection.Validation
             .Delete
             .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
 Operator:= _
               xlBetween, Formula1:=Join(gNameAbbrs, ",") 'this isn't 
 working
              'xlBetween , Formula1:="a,b,c" 'this works
             .InCellDropdown = True
             .InputMessage = ""
           End With


  #3   Report Post  
Posted to microsoft.public.excel.programming
TBD TBD is offline
external usenet poster
 
Posts: 41
Default Trouble with Validation formula1:=Join(... Is '!' reserved?

Hi Per Jessen,
Thanks for testing the code! Your work gives me greater confidence
that the actual problem was a special character in one of the list-items. My
pull-down list is file-names, and the first element of gNameAbbr() had a
leading '!'.

Many thanks,
Cheers!

"Per Jessen" wrote:

Hi

I tried to run the code below in both excel 2000 and 2007, with no errors.
Have you tried to move your code to a new workbook, to test if it also
happens there. Maybe your current workbook is somehow corrupted!

Sub test()
Dim MyArr(0 To 15) As String
For c = 0 To 15
MyArr(c) = "! A" & c
Next
MyString = Join(MyArr, ",")
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=Join(MyArr, ",") 'this isn't working
'xlBetween , Formula1:="a,b,c" 'this works
.InCellDropdown = True
.InputMessage = ""
End With
End Sub

Regards,
Per

"tbd" skrev i meddelelsen
...
Greetings,
I've written this question twice, and was about to abort it for the
second time, but will post it for comments, even though the problem may be
solved.

Note that below, the first string element of gNameAbbrs() had a leading
'!'
(exclamation mark), and removing it _seems_ to have made a difference!(?)

(the original question)
I don't understand why the the code below doesn't work. After it
executes, the affected cell does not allow for a pull-down list - even
though
the list DOES appear in Data\Validation dialog for the cell! Excel (2002)
also starts acting strange and will no longer quit via File\Exit Or the
window-close button - in either case a pop-up dialog announces that Excel
can't be exited. Killing Excel via TaskMgr is effective.

I've quintuple-checked the gNameAbbrs array (of Strings) is correctly
populated, again, the values ARE showing-up in Data\Validation UI.

Code:
            rRange.Select
            With Selection.Validation
              .Delete
              .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
  Operator:= _
                xlBetween, Formula1:=Join(gNameAbbrs, ",") 'this isn't 
  working
               'xlBetween , Formula1:="a,b,c" 'this works
              .InCellDropdown = True
              .InputMessage = ""
            End With
 



  #4   Report Post  
Posted to microsoft.public.excel.programming
TBD TBD is offline
external usenet poster
 
Posts: 41
Default Trouble with Validation formula1:=Join(... Is '!' a reserved

Hi Per Jessen,
That's what I get for not reading carefully - looks like you also have
a leading '!' in your list... Now I'm really stumped. I guess if it starts
happening again, I'll be back!

Thanks/Cheers!

"Per Jessen" wrote:

Hi

I tried to run the code below in both excel 2000 and 2007, with no errors.
Have you tried to move your code to a new workbook, to test if it also
happens there. Maybe your current workbook is somehow corrupted!

Sub test()
Dim MyArr(0 To 15) As String
For c = 0 To 15
MyArr(c) = "! A" & c
Next
MyString = Join(MyArr, ",")
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=Join(MyArr, ",") 'this isn't working
'xlBetween , Formula1:="a,b,c" 'this works
.InCellDropdown = True
.InputMessage = ""
End With
End Sub

Regards,
Per

"tbd" skrev i meddelelsen
...
Greetings,
I've written this question twice, and was about to abort it for the
second time, but will post it for comments, even though the problem may be
solved.

Note that below, the first string element of gNameAbbrs() had a leading
'!'
(exclamation mark), and removing it _seems_ to have made a difference!(?)

(the original question)
I don't understand why the the code below doesn't work. After it
executes, the affected cell does not allow for a pull-down list - even
though
the list DOES appear in Data\Validation dialog for the cell! Excel (2002)
also starts acting strange and will no longer quit via File\Exit Or the
window-close button - in either case a pop-up dialog announces that Excel
can't be exited. Killing Excel via TaskMgr is effective.

I've quintuple-checked the gNameAbbrs array (of Strings) is correctly
populated, again, the values ARE showing-up in Data\Validation UI.

Code:
            rRange.Select
            With Selection.Validation
              .Delete
              .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
  Operator:= _
                xlBetween, Formula1:=Join(gNameAbbrs, ",") 'this isn't 
  working
               'xlBetween , Formula1:="a,b,c" 'this works
              .InCellDropdown = True
              .InputMessage = ""
            End With
 



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
Data validation trouble Bbongo8 Excel Programming 1 January 8th 12 02:10 PM
data validation trouble copercar Excel Programming 0 May 15th 08 03:50 PM
Formula1 Property of Validation Object to refer to function name [email protected] Excel Programming 2 March 30th 06 12:53 AM
Trouble with validation funkymonkUK[_27_] Excel Programming 11 June 17th 05 02:54 PM


All times are GMT +1. The time now is 03:04 AM.

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"