View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Programing a button in excel

ActiveSheet.PivotTables(1).TableRange2.Copy

will copy the data in the pivot Table including pagefields. If you don't
want the pagefields, then use TableRange1

I might use something like:

set rng = ActiveSheet.PivotTables(1).TableRange2
workbooks.Add Template:=xlWBATWorksheet
Activesheet.Range("A1").Select
rng.copy
Activesheet.PasteSpecial xlValues
Activesheet.PasteSpecial xlFormats
ActiveWorkbook.Sendmail Subject:="Myfiles", "
Activeworkbook.close SaveChanges:=False





--
Regards,
Tom Ogilvy


"Josh Johansen" wrote:

I guess the thing I am unsure how to do is write a program that will select
the data currently displayed in the pivot table, copy that data, paste it to
a new mail message all with a programmed button. Because various users will
be using the pivot table, the size could be extremely different, I will read
through the link you left me and hopefully find some useful information,
thank you so much.

"Tom Ogilvy" wrote:

Take a look at Ron de Bruin's site:

http://www.rondebruin.nl/sendmail.htm

this has extensive information on mailing data from Excel. Your description
isn't very definitive, so you will have to decide what is appropriate.

--
Regards,
Tom Ogilvy


"Josh Johansen" wrote:

I would like to program a button that will copy a pivot table, and then paste
it into a new email message. This will prevent the users from being confused
with all the steps this would take manually. I am not too familiar with how
to do this, any ideas? Thanks.