Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default HowTo:Validation Formula = Array of strings

How do I code cell's validation formula to contain a string of values that
may contain commas?

i.e.
cells(1,1).validation.formula1="""1,000"",""2,000" ",""3,000"""

Expected to result
1,000
2,000
3,000

Instead I get
1
000
2
000
3
000

Thanks

I have the following values

A B
1 9/7,000 C
2 10/10,000 B
3 12/32,000 C

I have a function GetLimitList() in code

Function GetLimitList(Filter as string) as String()

GetLimitList = <MyLogic

End Function

Results in Array(9/7,000,12/32,000)

I then perform

With Names(NamedRange).RefersToRange

.Validation.Delete
.Validation.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
Operator:=xlBetween, Formula1:=Join(GetLimitList("C"), ",")
.Validation.IgnoreBlank = True
.Validation.InCellDropdown = True
.Validation.InputTitle = ""
.Validation.ErrorTitle = ""
.Validation.InputMessage = ""
.Validation.ErrorMessage = ""
.Validation.ShowInput = True
.Validation.ShowError = True

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
HOWTO: What is the formula to have evaluate a range of value apache007 Excel Discussion (Misc queries) 9 February 6th 10 06:17 PM
Array of Strings Zone Excel Discussion (Misc queries) 3 July 7th 06 04:52 PM
How do I find the number of elements in an Array of Strings? BeefmanSteve Excel Programming 5 June 17th 05 12:48 AM
Counting Strings in an Array ExcelMonkey[_190_] Excel Programming 9 March 16th 05 09:21 AM
Passing array of strings from DLL function to VBA Jag Man Excel Programming 0 January 12th 04 10:09 PM


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