Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
comparison string VBA excell
Option Explicit
Sub auto_open() Dim myRng As Range Dim myCell As Range Set myRng = Worksheets("sheet1").Range("a1:A1000") For Each myCell In myRng.Cells With myCell .Offset(0, 2).Validation.Delete If IsNumeric(.Value) _ And .Text Like "#.#" Then With .Offset(0, 2) .Value = "" With .Validation .Add Type:=xlValidateList, _ AlertStyle:=xlValidAlertStop, _ Operator:=xlBetween, Formula1:="Yes,No" .IgnoreBlank = True .InCellDropdown = True .InputTitle = "" .ErrorTitle = "" .InputMessage = "" .ErrorMessage = "" .ShowInput = True .ShowError = True End With End With End If End With Next myCell End Sub the above code checks if the format of the Column A is of the format integer.integer (2.2) how do i check the format integer.integer.integer.integer (2.2.2.2) i tried #.#.#.# it did not work |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
comparison string VBA excell
Just #.#.#.#?
With myCell .Offset(0, 2).Validation.Delete If .Text Like "#.#.#.#" Then Drop the isnumeric(.value) stuff. stats wrote: Option Explicit Sub auto_open() Dim myRng As Range Dim myCell As Range Set myRng = Worksheets("sheet1").Range("a1:A1000") For Each myCell In myRng.Cells With myCell .Offset(0, 2).Validation.Delete If IsNumeric(.Value) _ And .Text Like "#.#" Then With .Offset(0, 2) .Value = "" With .Validation .Add Type:=xlValidateList, _ AlertStyle:=xlValidAlertStop, _ Operator:=xlBetween, Formula1:="Yes,No" .IgnoreBlank = True .InCellDropdown = True .InputTitle = "" .ErrorTitle = "" .InputMessage = "" .ErrorMessage = "" .ShowInput = True .ShowError = True End With End With End If End With Next myCell End Sub the above code checks if the format of the Column A is of the format integer.integer (2.2) how do i check the format integer.integer.integer.integer (2.2.2.2) i tried #.#.#.# it did not work -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
comparison string VBA excell
Great!!!!!
|
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
comparison string VBA excell
Hey Dave,
Can I associate color with the formula "yes" and "no" Example if the user selects yes, cell color should be yellow, if he selects "no", it should be red |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
comparison string VBA excell
I am not sure if this can be achieved or not by Excel...
|
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
comparison string VBA excell
I think the easiest thing would be to use Format|conditional formatting.
stats wrote: Hey Dave, Can I associate color with the formula "yes" and "no" Example if the user selects yes, cell color should be yellow, if he selects "no", it should be red -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Browse File for Mac | Excel Discussion (Misc queries) | |||
Auto convert an alphanumeric string (CIS9638S) to numbers only? | Excel Worksheet Functions | |||
Excell deletes 0 when its the first number in a string | Excel Discussion (Misc queries) | |||
lable ranges in Excell | Excel Discussion (Misc queries) | |||
Read Text File into Excel Using VBA | Excel Discussion (Misc queries) |