Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
If y = x Like "x?" Then
'I am trying to compare two numbers. I want excel to
recognize "255135" to "255135k" I can't seem to get this to work. Any help would be appreciated. Thanks x = UCase(ActiveCell.Value) ActiveCell.Offset(1, 0).Select y = UCase(ActiveCell.Value) If y = x Like "x?" Then ActiveCell.Offset(0, 1).Select |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
If y = x Like "x?" Then
You're close... try this
Dim x, y x = UCase(ActiveCell.Value) ActiveCell.Offset(1, 0).Select y = UCase(ActiveCell.Value) If y Like x Then MsgBox "y like x" ActiveCell.Offset(0, 1).Select Else MsgBox "y not like x" End If -- sb "TEAMRacing" wrote in message ... 'I am trying to compare two numbers. I want excel to recognize "255135" to "255135k" I can't seem to get this to work. Any help would be appreciated. Thanks x = UCase(ActiveCell.Value) ActiveCell.Offset(1, 0).Select y = UCase(ActiveCell.Value) If y = x Like "x?" Then ActiveCell.Offset(0, 1).Select |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
If y = x Like "x?" Then
Got it! This is what I used.
x = UCase(ActiveCell.Value) ActiveCell.Offset(1, 0).Select y = UCase(ActiveCell.Value) Dim SearchString, SearchChar, MyPos SearchString = "y" SearchChar = "x" MyPos = InStr(1, y, x, 1) If MyPos = 1 Then -----Original Message----- 'I am trying to compare two numbers. I want excel to recognize "255135" to "255135k" I can't seem to get this to work. Any help would be appreciated. Thanks x = UCase(ActiveCell.Value) ActiveCell.Offset(1, 0).Select y = UCase(ActiveCell.Value) If y = x Like "x?" Then ActiveCell.Offset(0, 1).Select . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
If y = x Like "x?" Then
if y like (x & "?") then
y = "255135k" x = 255135 -- Regards Tom Ogilvy "TEAMRacing" wrote in message ... 'I am trying to compare two numbers. I want excel to recognize "255135" to "255135k" I can't seem to get this to work. Any help would be appreciated. Thanks x = UCase(ActiveCell.Value) ActiveCell.Offset(1, 0).Select y = UCase(ActiveCell.Value) If y = x Like "x?" Then ActiveCell.Offset(0, 1).Select |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel | |||
Complex if test program possible? If "value" "value", paste "value" in another cell? | Excel Discussion (Misc queries) |