Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programing a button in excel
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programing a button in excel
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programing a button in excel
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. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programing a button in excel
Here is what I copied:
Private Sub CommandButton1_Click() Set rng = ActiveSheet.PivotTables(1).TableRange2 Workbooks.Add Template:=zlWBATWorksheet ActiveSheet.Range("A1").Select rng.Copy Activesheeet.PasteSpecial xlValues ActiveSheet.PasteSpecial xlFormats ActiveWorkbook.SendMail Subject:="Scheduling", " ActiveWorkbook.Close SaveChanges:=False End Sub When I attempt to use the button I am getting. "Compile error, named argument not found." with the recipient portion highlighted. I have to admit I am not at all familiar with Visual Basic, what am I doing wrong? Thanks again. "Tom Ogilvy" wrote: 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. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programing a button in excel
Recipient should be plural: Recipients
also, you seem to have a typo in the Workbooks.Add Line. The constant is Workbooks.Add Template:=xlWBATWorksheet not Workbooks.Add Template:=zlWBATWorksheet -- Regards, Tom Ogilvy "Josh Johansen" wrote: Here is what I copied: Private Sub CommandButton1_Click() Set rng = ActiveSheet.PivotTables(1).TableRange2 Workbooks.Add Template:=zlWBATWorksheet ActiveSheet.Range("A1").Select rng.Copy Activesheeet.PasteSpecial xlValues ActiveSheet.PasteSpecial xlFormats ActiveWorkbook.SendMail Subject:="Scheduling", " ActiveWorkbook.Close SaveChanges:=False End Sub When I attempt to use the button I am getting. "Compile error, named argument not found." with the recipient portion highlighted. I have to admit I am not at all familiar with Visual Basic, what am I doing wrong? Thanks again. "Tom Ogilvy" wrote: 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel programing | Excel Discussion (Misc queries) | |||
Excel VB Programing | Excel Programming | |||
this is about excel programing | Excel Programming | |||
Programing Outlook using Excel | Excel Programming | |||
help with excel programing | Excel Programming |