PC Review


Reply
Thread Tools Rate Thread

Circular scripting between sheets in the same workbook

 
 
excel user
Guest
Posts: n/a
 
      6th May 2008
Hi All,
I am trying to find out if circular scripting is possible in excel and how
easily. We are trying to create a "web downloadable" excel with multiple
sheets and the idea is to have circular sripting between atleast 2 sheets
i.e. f somebody enters a value in a cell in sheet 1, it should be auto
populated in sheet 2 in a cell that refers to the cell in the first sheet and
vice versa. One way communication seems to be fairly easy. Where we are
running into trouble is having the 2 way communication i.e. 1=2 and 2=1.
 
Reply With Quote
 
 
 
 
Jacques ALARDET
Guest
Posts: n/a
 
      6th May 2008
Hello excel user

If Sheet1 = Sheet2 and vice versa, all cells containt a formula : If
somebody enter a value, he scratche the formule

This is correct, if the option Excel Iteration is active with 1 itération

But if somebody enter a value if sheet1!C5, he does nots enter another value
in Sheet2!C5 : because in this cause Sheet1 is not same Sheet2

I hope inderstand your trouble

J a c q u e s

"excel user" <excel (E-Mail Removed)> a écrit dans le message
de news:8E9E9EF1-31F1-4F4A-8968-(E-Mail Removed)...
> Hi All,
> I am trying to find out if circular scripting is possible in excel and how
> easily. We are trying to create a "web downloadable" excel with multiple
> sheets and the idea is to have circular sripting between atleast 2 sheets
> i.e. f somebody enters a value in a cell in sheet 1, it should be auto
> populated in sheet 2 in a cell that refers to the cell in the first sheet
> and
> vice versa. One way communication seems to be fairly easy. Where we are
> running into trouble is having the 2 way communication i.e. 1=2 and 2=1.
>


 
Reply With Quote
 
bruceceng@gmail.com
Guest
Posts: n/a
 
      6th May 2008
On May 6, 1:48 pm, excel user <excel u...@discussions.microsoft.com>
wrote:
> Hi All,
> I am trying to find out if circular scripting is possible in excel and how
> easily. We are trying to create a "web downloadable" excel with multiple
> sheets and the idea is to have circular sripting between atleast 2 sheets
> i.e. f somebody enters a value in a cell in sheet 1, it should be auto
> populated in sheet 2 in a cell that refers to the cell in the first sheet and
> vice versa. One way communication seems to be fairly easy. Where we are
> running into trouble is having the 2 way communication i.e. 1=2 and 2=1.


If I understand your question properly, I think you could do the
following:

Add the following event to Sheet1:

Private Sub Worksheet_Change(ByVal Target As Range)
If modifyFrom2 = False Then
modifyFrom1 = True
Sheet2.Range(Target.Address) = Target
modifyFrom1 = False
End If
End Sub


Add the following event to Sheet2:

Private Sub Worksheet_Change(ByVal Target As Range)
If modifyFrom1 = False Then
modifyFrom2 = True
Sheet1.Range(Target.Address) = Target
modifyFrom2 = False
End If
End Sub

Add the following code to a public module:

Dim modifyFrom1 As Boolean
Dim modifyFrom2 As Boolean

Basically any time a change is made to sheet 1, it will fire the event
which will copy the change to sheet2. However, before it copies to
sheet2 it will set a flag so that sheet2 will not try to rewrite back
to sheet1 (causing an infinite loop). However not all changes are
properly captured, like changes to formating and "dragging" of data.

Bruce Eng
bruceeng.com
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Sheets (Need to create 500 individual sheets in one workbook, pulling DATA Amaxwell Microsoft Excel Worksheet Functions 4 17th Aug 2006 06:23 AM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Microsoft Excel Discussion 6 29th Mar 2006 12:43 PM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Microsoft Excel Programming 6 29th Mar 2006 12:43 PM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Microsoft Excel Worksheet Functions 6 29th Mar 2006 12:43 PM
Macro for filter on protected workbook that works for all sheets, no matter what sheets are named? StargateFanFromWork Microsoft Excel Programming 6 26th Jan 2006 06:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:57 PM.