-
Need help with Excel Macro - InRange??
Hi there
This is an Excel question. I'm not so sure if it can be done or not.
I want the user to select a Cell in Column C before executing a macro. If any other cell is selected in any other column, except column C then I want a MsgBox saying "Please select an Account Number in Column C." When the user clicks on the OK button on the MsgBox, the macro exits. The user then selects and Account Number in Column C and then executes the macro.
Thanks,
Mario
-
Try this:
[vba]
Option Explicit
Sub Macro1()
Dim Prompt As String
Dim Title As String
If Intersect(ActiveCell, Range("C:C")) Is Nothing Then
Prompt = "Please select an Account Number in Column C."
Title = "Procedure Canceled"
MsgBox Prompt, vbCritical, Title
GoTo ExitSub:
End If
'The Rest Of Your Macro Here
ExitSub:
End Sub
[/vba]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules