View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
gmcnaugh gmcnaugh is offline
external usenet poster
 
Posts: 5
Default Copy a cell from a previous worksheet using a macro

Hi grateful for any help with the following:

I am trying to copy a cell from a previous worksheet to a current sheet
so that when the information in the previous sheet changes then the
relevant cell in the current sheet also chaneges. The following code
only copies the information when the macro is initially run and does
not alter if the copied cell information changes.

Sub Macro4()
'
' Macro4 Macro
' Macro recorded 31/01/2006 by McNaughton
'
' Keyboard Shortcut: Ctrl+n
'
Cells.Select
Selection.Copy
ActiveSheet.Next.Select
ActiveSheet.Paste
ActiveWindow.SmallScroll Down:=30
ActiveCell.Offset(32, 0).Range("A1:D54").Select
Application.CutCopyMode = False
Selection.ClearContents
ActiveWindow.ScrollRow = 15
ActiveWindow.ScrollRow = 14
ActiveWindow.ScrollRow = 13
ActiveWindow.ScrollRow = 12
ActiveWindow.ScrollRow = 11
ActiveWindow.ScrollRow = 10
ActiveWindow.ScrollRow = 9
ActiveWindow.ScrollRow = 8
ActiveWindow.ScrollRow = 7
ActiveWindow.ScrollRow = 6
ActiveWindow.ScrollRow = 5
ActiveWindow.ScrollRow = 4
ActiveWindow.ScrollRow = 3
ActiveWindow.ScrollRow = 2
ActiveWindow.ScrollRow = 1
ActiveCell.Offset(-31, 6).Range("A1:A85").Select
Selection.ClearContents
ActiveCell.Offset(0, -2).Range("A1").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = ActiveSheet.Previous.Range("F86")
End Sub

The problem area is the last line of code befor EndSub.

Any help would be gratefully received.

Thanks