Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Target Cell Problem

Using Excel 97

I'm trying to get a message box to appear when cell F5 of
page "Labour Details" is selected. Then if ybYes is
selected "Hire Calculation" page is shown and if vbno the
message box dissapears....

This is the chunk of code that I'm trying to get to
work... As you can guess it doesn't!!!!

Can anyone help????

Thanks

Wayne


Private Sub worksheet_selectionChange(ByVal Target As
Excel.Range)
If Sheets("Labour Details").Target.Address = "$f$5"
Then
If ActiveCell.HasFormula Then
MsgBox ("Change Value via Hire calculation
Page")
MsgBox = MsgBox & MsgBox(vbLf)
MsgBox = MsgBox & ("Go to Hire Calculation
Page?")
Title = "Protected Cell"
COnfig = vbYesNo
Ans = MsgBox(Msg, COnfig, Title)
If Ans = vbNo Then End
Else If Ans = vbYes Then
Sheets("Hire Calculation").Select
End If
End If
End If
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Target Cell Problem

Hi,
The following, placed in the Worksheet module of "Labour Details", would do
the main part of your requirement.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Res
If Target.Address < "$B$5" Then Exit Sub
Res = MsgBox("Change Value Hire calculation Page ?", vbYesNo, "")
If Res = vbNo Then Exit Sub
Sheets("Hire Calculation").Select
End Sub

I think you have a small problem with syntax of the MsgBox.
Your reference to "$B$5" also looks a little unusual.

regards,
Don


"Wayne" wrote in message
...
Using Excel 97

I'm trying to get a message box to appear when cell F5 of
page "Labour Details" is selected. Then if ybYes is
selected "Hire Calculation" page is shown and if vbno the
message box dissapears....

This is the chunk of code that I'm trying to get to
work... As you can guess it doesn't!!!!

Can anyone help????

Thanks

Wayne


Private Sub worksheet_selectionChange(ByVal Target As
Excel.Range)
If Sheets("Labour Details").Target.Address = "$f$5"
Then
If ActiveCell.HasFormula Then
MsgBox ("Change Value via Hire calculation
Page")
MsgBox = MsgBox & MsgBox(vbLf)
MsgBox = MsgBox & ("Go to Hire Calculation
Page?")
Title = "Protected Cell"
COnfig = vbYesNo
Ans = MsgBox(Msg, COnfig, Title)
If Ans = vbNo Then End
Else If Ans = vbYes Then
Sheets("Hire Calculation").Select
End If
End If
End If
End Sub



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
Target cell reference moves when target is cut and pasted Illya Teideman Excel Discussion (Misc queries) 5 May 31st 07 11:34 AM
In cell drop down menu with seprerate numerical target cell Remco Excel Discussion (Misc queries) 2 October 24th 06 11:39 AM
In adjacent cell, show last date modified of target cell. manxman Excel Discussion (Misc queries) 0 March 17th 06 10:47 PM
How find if target is object in Worksheet_Change (ByVal Target As.. ?) Gunnar Johansson Excel Programming 3 July 1st 04 09:25 PM
How to find and sub total a specific number of cell above the target cell jane Excel Programming 1 January 21st 04 03:37 PM


All times are GMT +1. The time now is 06:39 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"