LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 215
Default Implied Circular Reference ... in w/s SelectionChange Event

Hello;

On a w/s, there are a dozen or so input-related cells. Let us concentrate
on cells G7 and I7.

If I enter or change the value in cell G7, the value in I7 should be
"=I7/50.".
If I enter or change the value in cell I7, the value in G7 should be
"=I7*50.".

I used w/s SelectionChange Event to do the trick! Here is a sample code for
the two related cells G7 and I7.
==========================================
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'
Application.CommandBars("Circular Reference").Visible = False
'
If ActiveCell.Row = 7 Then
If ActiveCell.Column = 7 Then
ActiveCell.Offset(0, 2).Formula = "=" & ActiveCell.Address(False,
False) & "/50."
ElseIf ActiveCell.Column = 9 Then
ActiveCell.Offset(0, -2).Formula = "=" & ActiveCell.Address(False,
False) & "*50."
End If
End If

End Sub
=========================================

The above code works fine, but with a glitch!
Enter a value in cell G7, and cell I7 would show the correct value.
Now, select cell I7, and the value in G7 would show 0.00.
Change the value in cell I7, and the value in G7 would be correct again!

If you select either cell, but don't change its value, the other cell would
show 0.00.

Your suggestion(s) would be greatly appreciated.

Thank you kindly.


 
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
change cell event using circular reference - not VBA! Dan Excel Worksheet Functions 3 June 17th 08 03:26 PM
change cell event using circular reference Dan Excel Worksheet Functions 3 June 17th 08 10:32 AM
SelectionChange event Kate Excel Programming 2 December 22nd 05 06:03 PM
SelectionChange event Stefi Excel Programming 2 October 28th 04 01:26 PM
SelectionChange Event Squid[_3_] Excel Programming 5 February 11th 04 01:57 PM


All times are GMT +1. The time now is 11:57 PM.

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

About Us

"It's about Microsoft Excel"