Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Modify a remote cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Modify a remote cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Modify a remote cell

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
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
Remove value from remote cell Kenneth Excel Discussion (Misc queries) 4 November 18th 08 02:39 AM
addition to a remote cell TBob Excel Programming 2 January 26th 08 09:07 PM
Remote cell reference in formulae Graham Excel Discussion (Misc queries) 3 July 25th 07 01:32 PM
forcing value into remote cell bcamp1973 Excel Discussion (Misc queries) 1 March 10th 06 05:50 PM
REMOTE CELL FUNCTION Dan Excel Worksheet Functions 1 June 7th 05 07:06 PM


All times are GMT +1. The time now is 02:49 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"