Get value from cell when another cell changes then reset

flatpro

New Member
Joined
Apr 14, 2013
Messages
2
When cell A1 changes in Excel to 1 (fed via an external com process) I want another cell, A3, to display the value of cell A2 (also fed by an external program)


I need A3 to keep displaying the same value of A1 until A4 displays 'A' at which time A3 to start to monitor for changes to A1 again (A1 will now not display 0)


Does anyone know if this is possible in vba...?
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
When cell A1 changes in Excel to 1 (fed via an external com process) I want another cell, A3, to display the value of cell A2 (also fed by an external program)


I need A3 to keep displaying the same value of A1 until A4 displays 'A' at which time A3 to start to monitor for changes to A1 again (A1 will now not display 0)


Does anyone know if this is possible in vba...?

Paragraph 2 conflicts with the requiremnt of paragraph 1. What does A3 display and what is the criteria for A3 to switch from monitoring A1 to A2 and vice versa?
 
Upvote 0
Sorry!

I meant,

"When cell A1 changes in Excel to 1 (fed via an external com process) I want another cell, A3, to display the value of cell A2 (also fed by an external program)


I need A3 to keep displaying the same value of A2 until A4 displays 'A' at which time A3 to start to monitor A1 for changes again (A1 will not display 1)"

So if A1 = 1
A3 = A2

Until A4 = 'A'
(At this point A1 will != 1)
Start monitoring the value of A1 again, like a reset...
 
Upvote 0
I'll take a stab at it. Copy this code to the code module in the worksheet. To access the code module, right click the sheet name tab, then click 'View Code' in the pop up menu. If the the data in A1:A4 does not perform as desired, then delete the code from the sheet code module, to prevent the automatic responses.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = $A$1 And Target = 1 And Range("A4") <> "A" Then
 Range("A3") = Range("A2").Value
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,394
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top