Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
XL 2007 - Out of Memory - memory leak/bug? PCLIVE Excel Discussion (Misc queries) 0 March 23rd 09 03:31 PM
Write data back from a form to sheet Steen Excel Discussion (Misc queries) 9 October 22nd 08 01:22 PM
HOW CAN I ADD BUTTON ON SHEET AND LET MARCO RUN? orvar Excel Discussion (Misc queries) 0 October 24th 07 10:29 AM
write formula that icludes data from sheet 1 to sheet 2 of my spr john Excel Worksheet Functions 1 September 14th 07 03:22 AM
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? Daniel Excel Worksheet Functions 1 June 23rd 05 11:38 PM


All times are GMT +1. The time now is 08:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"