Thread: Export sheets
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Export sheets

You can certainly copy data as you describe. It would require defining
where the data exists and where you want to put it, then just the opposite
for putting it back.

Worksheets("Data").Range("A1").Value =
Worksheets("sheet1").Range("B9").Value

would be a simple example. To put it back, you would reverse it.

Worksheets("sheet1").Range("B9").Value =
Worksheets("Data").Range("A1").Value

To copy sheet(s) and email them:

Dim sh as Worksheet
' copy sheets to a new workbook
Worksheets(Array(1,5)).Copy
for each sh in Activeworkbook.Worksheets
Sh.Cells.copy
Sh.Cells.PasteSpecial xlValues
Next
Activeworkbook.SendMail , Subject:="New Book"
Activeworkbook.close Savechanges:=False

--
Regards,
Tom Ogilvy


"Welshy" wrote in message
...

Can anyone help me - refer me to a template example? I have been
writing (or attempting to) various stuff in excel but am still
learning.

I have written a spreadsheet/programme that i use for various projects.
The programme contains around 10 worksheets that users have to enter
info into.

It is a large programme, and is now nearly 1mb in size, also i am
constantly improving/updating.

Is there any way that i can say copy all of the data in all worksheets
(i.e. cell contents - not worried about formatting) onto 1 sheet, and
then saving that sheet as say the data file. When the user then opens
the programme, they enter which filename that they wish to work with
and it imports all of the data from the data file into the correct
place on each worksheet.

Is there also a way that the user can export sheets to another file to
send by email for someone to use e.g export sheet 1 and 5 (will need
the formatting but not worried about the calculations etc), so that the
outside party then has the data but not the programme workings (or
size).

Thanks for your help in advance as i have been trying to crack this one
for ages and haven't got very far.


--
Welshy
------------------------------------------------------------------------
Welshy's Profile:

http://www.excelforum.com/member.php...o&userid=16019
View this thread: http://www.excelforum.com/showthread...hreadid=274840