Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I diverted my question from General Question as I think my problem related to
programming. Hi all, I have a table, let say B2:F6 when I type the 2 in A7, 2 in A8 the value in C3 will be removed or changed to zero. Do I need to use macro to do? B2:F6 is the source. I am not available to change them to equations. Thanks, Kenneth |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Worksheet_Change(ByVal Target As Range)
Set A78 = Range("A7:A8") Set A7 = Range("A7") Set A8 = Range("A8") Set C3 = Range("C3") If Intersect(A78, Target) Is Nothing Then Exit Sub If A7 < 2 Or A8 < 2 Then Exit Sub Application.EnableEvents = False C3.Value = 0 Application.EnableEvents = True End Sub Because it is worksheet code, it is very easy to install and automatic to use: 1. right-click the tab name near the bottom of the Excel window 2. select View Code - this brings up a VBE window 3. paste the stuff in and close the VBE window If you have any concerns, first try it on a trial worksheet. If you save the workbook, the macro will be saved with it. To remove the macro: 1. bring up the VBE windows as above 2. clear the code out 3. close the VBE window To learn more about macros in general, see: http://www.mvps.org/dmcritchie/excel/getstarted.htm To learn more about Event Macros (worksheet code), see: http://www.mvps.org/dmcritchie/excel/event.htm -- Gary''s Student - gsnu200814 "Kenneth" wrote: I diverted my question from General Question as I think my problem related to programming. Hi all, I have a table, let say B2:F6 when I type the 2 in A7, 2 in A8 the value in C3 will be removed or changed to zero. Do I need to use macro to do? B2:F6 is the source. I am not available to change them to equations. Thanks, Kenneth |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Value of A7 and A8 is get from another cell equation,
so I need to define all the cells ? I mean the C3 cell. Or I tell you my job need to be done below. There is a Distance table. eg. 10 x 10. I want to solve the shortest path. So when i get from "point1" to "point2" is 3meters. I need to remove the "point2" to "point1" that value, otherwise, i would be in a loop. I hope this can make you easier to help me. Kenneth "Gary''s Student" wrote: Private Sub Worksheet_Change(ByVal Target As Range) Set A78 = Range("A7:A8") Set A7 = Range("A7") Set A8 = Range("A8") Set C3 = Range("C3") If Intersect(A78, Target) Is Nothing Then Exit Sub If A7 < 2 Or A8 < 2 Then Exit Sub Application.EnableEvents = False C3.Value = 0 Application.EnableEvents = True End Sub Because it is worksheet code, it is very easy to install and automatic to use: 1. right-click the tab name near the bottom of the Excel window 2. select View Code - this brings up a VBE window 3. paste the stuff in and close the VBE window If you have any concerns, first try it on a trial worksheet. If you save the workbook, the macro will be saved with it. To remove the macro: 1. bring up the VBE windows as above 2. clear the code out 3. close the VBE window To learn more about macros in general, see: http://www.mvps.org/dmcritchie/excel/getstarted.htm To learn more about Event Macros (worksheet code), see: http://www.mvps.org/dmcritchie/excel/event.htm -- Gary''s Student - gsnu200814 "Kenneth" wrote: I diverted my question from General Question as I think my problem related to programming. Hi all, I have a table, let say B2:F6 when I type the 2 in A7, 2 in A8 the value in C3 will be removed or changed to zero. Do I need to use macro to do? B2:F6 is the source. I am not available to change them to equations. Thanks, Kenneth |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Remove value from remote cell | Excel Discussion (Misc queries) | |||
addition to a remote cell | Excel Programming | |||
Remote cell reference in formulae | Excel Discussion (Misc queries) | |||
forcing value into remote cell | Excel Discussion (Misc queries) | |||
REMOTE CELL FUNCTION | Excel Worksheet Functions |