Home |
Search |
Today's Posts |
#1
|
|||
|
|||
copying a cell to another cell automatically
Hi,
I'm trying to set up my worksheet so that if the value in column E is changed to 100%, the value in column A of that row automatically changes to 100, regardless of its original value. At the same time, I don't want to lock down column A - the user can enter any value in here when E is not 100%. How do I go about doing this? Do I need to write a macro? Thanks! Amit |
#2
|
|||
|
|||
Hi,
You'll have to do this as a little macro. Go into the VB editor and add the following into the relevant Sheet. Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 5 And Target = 100 Then Cells(Target.Row, 1) = 100 End If End Sub You might want to check for ABS (target - 100) < some small number rather than equality. HTH, David Jessop "Amit" wrote: Hi, I'm trying to set up my worksheet so that if the value in column E is changed to 100%, the value in column A of that row automatically changes to 100, regardless of its original value. At the same time, I don't want to lock down column A - the user can enter any value in here when E is not 100%. How do I go about doing this? Do I need to write a macro? Thanks! Amit |
#3
|
|||
|
|||
Awesome, thanks!
"David Jessop" wrote in message ... Hi, You'll have to do this as a little macro. Go into the VB editor and add the following into the relevant Sheet. Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 5 And Target = 100 Then Cells(Target.Row, 1) = 100 End If End Sub You might want to check for ABS (target - 100) < some small number rather than equality. HTH, David Jessop "Amit" wrote: Hi, I'm trying to set up my worksheet so that if the value in column E is changed to 100%, the value in column A of that row automatically changes to 100, regardless of its original value. At the same time, I don't want to lock down column A - the user can enter any value in here when E is not 100%. How do I go about doing this? Do I need to write a macro? Thanks! Amit |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can Comments be automatically converted to text cell values? | Excel Discussion (Misc queries) | |||
Excel: How do I enter a date in one cell & automatically dates adj | Excel Discussion (Misc queries) | |||
Excel merged cell - can it automatically expand as text is typed? | New Users to Excel | |||
automatically insert system time in a cell | Excel Discussion (Misc queries) | |||
prevent 4/5 in a cell automatically transfer to a date format | Excel Discussion (Misc queries) |