Hello everyone!
Am very new to Excel VBA, & need help urgently in the following area (please!). On clicking into a range of cells, need to activate a MsgBox.
Example of this is range A40:A50, within worksheet1.
Example of code under worksheet1 is:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Sheet1.Range(A39, A43) Then
StaffCosts
End If
End Sub
Code will then call a sub/function to display message, as per following example:
Sub StaffCosts()
MsgBox "[Message]", vbInformation + vbOKOnly, "[Title of Message to Users]"
End Sub
As mentioned above am very, very new to Excel VBA. Basically I would like to know the Excelequivalent of the appropriate event for the cell ranges upon which to trigger the above message from code, (similar to events on forms within MS Access).
Further note: have successfully managed to manually run the code from the Tools | Macro | Macros...|Run menu.
However I want to trigger the msgbox each time the user selects a value from a drop-down list, and enters this into cells A40 to A50.
Would really appreciate some help with this very soon. Many, many thanks in advance.
Kind regards, - Magnetar![[atom] [atom] [atom]](/data/assets/smilies/atom.gif)
Am very new to Excel VBA, & need help urgently in the following area (please!). On clicking into a range of cells, need to activate a MsgBox.
Example of this is range A40:A50, within worksheet1.
Example of code under worksheet1 is:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Sheet1.Range(A39, A43) Then
StaffCosts
End If
End Sub
Code will then call a sub/function to display message, as per following example:
Sub StaffCosts()
MsgBox "[Message]", vbInformation + vbOKOnly, "[Title of Message to Users]"
End Sub
As mentioned above am very, very new to Excel VBA. Basically I would like to know the Excelequivalent of the appropriate event for the cell ranges upon which to trigger the above message from code, (similar to events on forms within MS Access).
Further note: have successfully managed to manually run the code from the Tools | Macro | Macros...|Run menu.
However I want to trigger the msgbox each time the user selects a value from a drop-down list, and enters this into cells A40 to A50.
Would really appreciate some help with this very soon. Many, many thanks in advance.
Kind regards, - Magnetar
![[atom] [atom] [atom]](/data/assets/smilies/atom.gif)