Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Validate part of string
Hi,
I'm not sure how to go about this. I need to validate a textbox. Any value can be in the textbox but if certain values are there they need to be the first item in the box and 3 of them must be spelled correctly. The items: "Major", "Major Tenant", & "Anchor" must be spelled correctly, but they can have additional information after them. Here's what I have so far: i = InStr(frmStoreData.txtAddUnitNos, "Maj") If i < 1 Then MsgBox ("Major must be the first item listed") Good = False End If i = InStr(frmStoreData.txtAddUnitNos, "Anc") If i < 1 Then MsgBox ("Anchor must be the first item listed") Good = False End If i = InStr(frmStoreData.txtAddUnitNos, "Pad") If i < 1 Then MsgBox ("Pad must be the first item listed") Good = False End If i = InStr(frmStoreData.txtAddUnitNos, "Ret") If i < 1 Then MsgBox ("Retail must be the first item listed") Good = False End If How would I check the spelling for just that portion of the string? -- Thanks for your help. Karen53 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Validate part of string
It might be easier to place a listbox containing the items "Major","Major
Tenant", etc before the textbox, and allow the user to select from that list if appropriate before typing any additional text in the textbox. Then just concatenate the selected list item with the textbox contents. Tim "Karen53" wrote in message ... Hi, I'm not sure how to go about this. I need to validate a textbox. Any value can be in the textbox but if certain values are there they need to be the first item in the box and 3 of them must be spelled correctly. The items: "Major", "Major Tenant", & "Anchor" must be spelled correctly, but they can have additional information after them. Here's what I have so far: i = InStr(frmStoreData.txtAddUnitNos, "Maj") If i < 1 Then MsgBox ("Major must be the first item listed") Good = False End If i = InStr(frmStoreData.txtAddUnitNos, "Anc") If i < 1 Then MsgBox ("Anchor must be the first item listed") Good = False End If i = InStr(frmStoreData.txtAddUnitNos, "Pad") If i < 1 Then MsgBox ("Pad must be the first item listed") Good = False End If i = InStr(frmStoreData.txtAddUnitNos, "Ret") If i < 1 Then MsgBox ("Retail must be the first item listed") Good = False End If How would I check the spelling for just that portion of the string? -- Thanks for your help. Karen53 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Validate part of string
Thank you, Tim.
-- Thanks for your help. Karen53 "Tim Williams" wrote: It might be easier to place a listbox containing the items "Major","Major Tenant", etc before the textbox, and allow the user to select from that list if appropriate before typing any additional text in the textbox. Then just concatenate the selected list item with the textbox contents. Tim "Karen53" wrote in message ... Hi, I'm not sure how to go about this. I need to validate a textbox. Any value can be in the textbox but if certain values are there they need to be the first item in the box and 3 of them must be spelled correctly. The items: "Major", "Major Tenant", & "Anchor" must be spelled correctly, but they can have additional information after them. Here's what I have so far: i = InStr(frmStoreData.txtAddUnitNos, "Maj") If i < 1 Then MsgBox ("Major must be the first item listed") Good = False End If i = InStr(frmStoreData.txtAddUnitNos, "Anc") If i < 1 Then MsgBox ("Anchor must be the first item listed") Good = False End If i = InStr(frmStoreData.txtAddUnitNos, "Pad") If i < 1 Then MsgBox ("Pad must be the first item listed") Good = False End If i = InStr(frmStoreData.txtAddUnitNos, "Ret") If i < 1 Then MsgBox ("Retail must be the first item listed") Good = False End If How would I check the spelling for just that portion of the string? -- Thanks for your help. Karen53 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula to validate characters within a string of data in aparticular cell | Excel Discussion (Misc queries) | |||
Need formula to locate and validate specific text from a string | Excel Discussion (Misc queries) | |||
Search/Match/Find ANY part of string to ANY part of Cell Value | Excel Worksheet Functions | |||
part of string | Excel Programming | |||
Use part of string | Excel Programming |