Hi,
From your other Thread, ( https://excelfox.com/forum/showthrea...ll=1#post14871 )
Originally Posted by
DocAElstein
....I did just record a macro whilst selecting the arrow on a drop down list. Unfortunately , no coding is produced by this: Not all actions taken manually produce coding by the macro recorder. So this does not help us. ....
I am 90% sure that we cannot automate with VBA the clicking of the arrow.
You could possibly check by asking the question at some other places / Forums., just to be sure. I may be wrong because I have not done much with drop down validation things
The best I can offer is a macro which will give you a message box for a few seconds to tell the person clicking the cell to select the arrow.
This would need to go in a normal macro module
Code:
' Pseudo Non Modal MsgBox, MessageBoxA API Standard Non Standard Stuff, More Fundamentally complicated UnWRap it and.. "Pseudo Non Modal MsgBox" --- A valid handle, hWnd, other than the Excel spreadsheet window ( Private Declare Function FindWndNumber Lib "user32" Alias "FindWindowA" (Optional ByVal lpClassName As String, Optional ByVal lpWindowName As String) As Long --- hWndParent = FindWndNumber(lpClassName:="XLMAIN", lpWindowName:=vbNullString) ), or even no ( Null ) hWnd results in a pseudo Non Modal MsgBox http://www.excelfox.com/forum/showthread.php/2227-VBA-Input-Pop-up-Boxes-Application-InputBox-Method-versus-VBA-InputBox-Function?p=10476#post10470 http://www.tek-tips.com/faqs.cfm?fid=4699
Public Declare Function APIsinUserDLL_MsgBox Lib "user32.dll" Alias "MessageBoxTimeoutA" (Optional ByVal hWnd As Long, Optional ByVal Prompt As String, Optional ByVal Title As String, Optional ByVal uType As Long, Optional ByVal wLanguageID As Long, Optional ByVal Delay_ms As Long) As Long ' https://www.excelforum.com/development-testing-forum/1215283-gimmie-da-codexamples-call-in-the-appendix-posts-2018-no-reply-needed-but-if-u.html#post4822413
This would need to go in the worksheets code module
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$B$3" Then
APIsinUserDLL_MsgBox hWnd:=WndNumber, Prompt:="Please click Arrow shown on right side of the cell", Title:="NonModalPopUpThingy", Delay_ms:=2000 '
Else
End If
End Sub
Alan
Bookmarks