Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have a formula In cell A1 that has the value MP. If the Value in cell A2 begins with the letter A I want a userform t pop up. I've tried this and it does not work: Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Target.Address = "$A$2" Then If Range("A1").Value = "MP" Then If Left("A2", 1) = ("A*") Then CheckTool.Show End If End If End If End Sub Any ideas -- Kevla ----------------------------------------------------------------------- Kevlar's Profile: http://www.excelforum.com/member.php...nfo&userid=723 View this thread: http://www.excelforum.com/showthread.php?threadid=26522 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Target.Address = "$A$2" Then If Range("A1").Value = "MP" Then If Left("A2", 1) = "A" Then CheckTool.Show End If End If End If End Sub -- Regards, Tom Ogilvy "Kevlar" wrote in message ... I have a formula In cell A1 that has the value MP. If the Value in cell A2 begins with the letter A I want a userform to pop up. I've tried this and it does not work: Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Target.Address = "$A$2" Then If Range("A1").Value = "MP" Then If Left("A2", 1) = ("A*") Then CheckTool.Show End If End If End If End Sub Any ideas? -- Kevlar ------------------------------------------------------------------------ Kevlar's Profile: http://www.excelforum.com/member.php...fo&userid=7231 View this thread: http://www.excelforum.com/showthread...hreadid=265222 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Get rid of the * after the A. You will only run the code when the firs character in cell A2 is A* (which can never happen since that is tw characters). -- kkkni ----------------------------------------------------------------------- kkknie's Profile: http://www.excelforum.com/member.php...nfo&userid=754 View this thread: http://www.excelforum.com/showthread.php?threadid=26522 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
change line 3 to read If LEFT(A2,1)="A" then....
"A2" is a string, not a cell reference, remove quotes The value you are checking (the leftmost one character in cell A2) cannot possibly equal the two character string "A*". Sorry, the pattern match character doesn't work this way in Excel. Steve "Kevlar" wrote in message ... I have a formula In cell A1 that has the value MP. If the Value in cell A2 begins with the letter A I want a userform to pop up. I've tried this and it does not work: Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Target.Address = "$A$2" Then If Range("A1").Value = "MP" Then If Left("A2", 1) = ("A*") Then CheckTool.Show End If End If End If End Sub Any ideas? -- Kevlar ------------------------------------------------------------------------ Kevlar's Profile: http://www.excelforum.com/member.php...fo&userid=7231 View this thread: http://www.excelforum.com/showthread...hreadid=265222 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Test left character is a number? | Excel Discussion (Misc queries) | |||
problem with test to columns feature identifying odd delimiting character | Excel Discussion (Misc queries) | |||
How to test if the end character of a string is within a user-definedlist? | Excel Discussion (Misc queries) | |||
Elimination of "box character" at end of test line | Excel Discussion (Misc queries) | |||
Test for Single Character That is in an Array | Excel Worksheet Functions |