Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Casey
 
Posts: n/a
Default Worksheet_SelectionChange Problem


Hi,
I'm trying to have a reminder message pop up when a certain cell is
selected. I would like to do this with VBA as opposed to doing it with
a Data Validation input message. I've tried the following code but to
no avail. Here's the code followed by the error message.

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

If Target.Row = 5 And Target.Column = 6 Then
MsgBox = "Have you verified your Extra Material setting in cell
A1? Normal setting is 25."
End If

End Sub

I get the following error message:

---------------------------
Microsoft Visual Basic
---------------------------
Compile error:

Function call on left-hand side of assignment must return Variant or
Object
---------------------------
OK Help
---------------------------


--
Casey


------------------------------------------------------------------------
Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545
View this thread: http://www.excelforum.com/showthread...hreadid=469251

  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

Casey,

No equal sign on the MsgBox line:

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

If Target.Row = 5 And Target.Column = 6 Then
MsgBox "Have you verified your Extra Material setting in cell A1? Normal setting is 25."
End If

End Sub

You can also modify other cells, or check the input value with the change event.

HTH,
Bernie
MS Excel MVP


"Casey" wrote in message
...

Hi,
I'm trying to have a reminder message pop up when a certain cell is
selected. I would like to do this with VBA as opposed to doing it with
a Data Validation input message. I've tried the following code but to
no avail. Here's the code followed by the error message.

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

If Target.Row = 5 And Target.Column = 6 Then
MsgBox = "Have you verified your Extra Material setting in cell
A1? Normal setting is 25."
End If

End Sub

I get the following error message:

---------------------------
Microsoft Visual Basic
---------------------------
Compile error:

Function call on left-hand side of assignment must return Variant or
Object
---------------------------
OK Help
---------------------------


--
Casey


------------------------------------------------------------------------
Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545
View this thread: http://www.excelforum.com/showthread...hreadid=469251



  #3   Report Post  
Casey
 
Posts: n/a
Default


Bernie,
Thanks for the help. Worked like a charm. Thanks for the added
suggestions as well. I might have some uses for those in some other
spreadsheet apps. Thanks again.


--
Casey


------------------------------------------------------------------------
Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545
View this thread: http://www.excelforum.com/showthread...hreadid=469251

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem office assistant R.VENKATARAMAN Excel Discussion (Misc queries) 0 June 15th 05 06:22 AM
Excel Display Problem Bill Martin -- (Remove NOSPAM from address) Excel Discussion (Misc queries) 0 April 19th 05 05:25 PM
EXCEL 2003 PROBLEM Amandle Excel Worksheet Functions 4 April 1st 05 02:25 PM
Freeze Pane problem in shared workbooks JM Excel Discussion (Misc queries) 1 February 1st 05 12:04 AM
Row Autofit problem Excel 2003 Matthias Klaey Excel Discussion (Misc queries) 0 January 19th 05 05:33 PM


All times are GMT +1. The time now is 02:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"