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...?
 

Some videos you may like

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

JLGWhiz

Well-known Member
Joined
Feb 7, 2012
Messages
12,979
Office Version
  1. 2013
Platform
  1. Windows
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?
 

flatpro

New Member
Joined
Apr 14, 2013
Messages
2
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...
 

JLGWhiz

Well-known Member
Joined
Feb 7, 2012
Messages
12,979
Office Version
  1. 2013
Platform
  1. Windows
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
 

Watch MrExcel Video

Forum statistics

Threads
1,122,518
Messages
5,596,622
Members
414,082
Latest member
sasmita

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
Top