Export sheets

  • Thread starter Thread starter Welshy
  • Start date Start date
W

Welshy

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

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

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

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

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

Thanks for your help in advance as i have been trying to crack this on
for ages and haven't got very far
 
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 Recipients:[email protected], Subject:="New Book"
Activeworkbook.close Savechanges:=False
 
hi,
part1 - importing data
yes this could be done with a macro. but you would have
the reverse happen when the user is done. exporting the
user input to the "data" file. you did not provide enough
info to help you there.
Personally i would have considered a master workbook with
10 buttons each opening a different workbook that
contained the template on one sheet and the data on
another. but i don't know how many users you have so you
ay be going in the right direction.
Part2 - e-mail
see this site
http://www.rondebruin.nl/sendmail.htm
it has sample code for mailing excel just about anyway you
can think of.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top