Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
write marco to put data from sheet to memory
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
write marco to put data from sheet to memory
Hi, I tried to use these code, However, I need the
variable that can be shared among different modules and different workbooks. e.g, I have written an addin workbook : addin.xla and I declared an array called arr1() as double. then I use this array in other sheet to copy the values into this array from another workbook book1,xls and I find that it doesn't work. may you help me again? thanks Desmond -----Original Message----- 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 . . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
write marco to put data from sheet to memory
Hi, I tried to use these code, However, I need the variable that can be
shared among different modules and different workbooks. e.g, I have written an addin workbook : addin.xla and I declared an array called arr1() as double. then I use this array in other sheet to copy the values into this array from another workbook book1,xls and I find that it doesn't work. may you help me again? thanks Desmond *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
XL 2007 - Out of Memory - memory leak/bug? | Excel Discussion (Misc queries) | |||
Write data back from a form to sheet | Excel Discussion (Misc queries) | |||
HOW CAN I ADD BUTTON ON SHEET AND LET MARCO RUN? | Excel Discussion (Misc queries) | |||
write formula that icludes data from sheet 1 to sheet 2 of my spr | Excel Worksheet Functions | |||
is it possible to execute write to the fields in another .xsl form a macro in another .xsl? e.g. some way to load another .xsl into an .xsl macro and write to its data? | Excel Worksheet Functions |