View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove
 
Posts: n/a
Default Circular Reference

munim wrote...
This is not exactly what I want...

I want something like....

I've sort of two cells in different sheets... if i update one of the
cells then it will automatically update the other one... and VISE VERSA

....

Select both worksheets, that is, with one of these worksheets as the
active 'tab', hold down a [Ctrl] key and click on the other worksheet's
tab. Make sure that when one of these two worksheets is active, the
other is selected. Then *EVERYTHING* you do in one will be done in the
other. You could automate ensuring they're both selected using an event
handler in the ThisWorkbook class module. For example,


Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Const WKSCOL As String = "Sheet1:Sheet3"

On Error GoTo End_Proc
Application.EnableEvents = False
Application.ScreenUpdating = False

If InStr(1, WKSCOL, Sh.Name) 0 Then
Sheets(Split(WKSCOL, ":")).Select
Sh.Activate
End If

End_Proc:
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub


If you're running Excel 8 (97) or prior, add the following additional
code.


#If Not VBA6 Then
Private Function Split(s As String, c As String) As Variant
Dim rv() As String
Dim k As Long, n As Long, p As Long, q As Long

k = 0
n = 7
ReDim rv(0 To n)

q = 1
p = InStr(q, s, c)

Do While p 0
rv(k) = Mid(s, q, p - q)
q = p + Len(c)
p = InStr(q, s, c)
k = k + 1

If k = n Then
n = n + k + 1
ReDim Preserve rv(0 To n)
End If
Loop

rv(k) = Mid(s, q)

ReDim Preserve rv(0 To k)
Split = rv
End Function
#End If