View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_9_] Patrick Molloy[_9_] is offline
external usenet poster
 
Posts: 15
Default write marco to put data from sheet to memory

if you declare your variables as Public, they are
available so be used in other routines...


Option Explicit
Public Temp As Variant
Sub Main()
Call subFirst
Call subSecond
End Sub
Sub subFirst()
Dim x
x = Workbooks("Book1").Sheets("Sheet1").Range("A1:C7")
Temp = Workbooks("Book1").Sheets("Sheet1").Range
("A1:C7")
End Sub
Sub subSecond()
Workbooks("Book2").Sheets("Sheet1").Range("A1:C7") =
Temp
End Sub


Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
Hi, I would like to write macro or dll
to copy a range of data from excel sheets to
memory so that I can recall these data from
other books or macros.
can anybody help me? Thanks
.