![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 85
|
Hi, I have recently made an invoice template for my freight forwarding company and I would like to send it as workbook attachment on an E-mail using MS outlook when I click a button, however this is the tricky part on this invoice template I have buttons I woukld like to have the Invoice saved as an attachment without the buttons if it helps my invoice is on the following cells A1 to G49
Can someone help me please I really need to find out how to do this very quickly and don't have time to learn visual basic! |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Posts: 85
|
please?
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Posts: 85
|
I need this
|
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Location: Leicestershire, U K
Posts: 157
|
Try this
Sub sendsheet1() 'Declare String Dim sAddress As String 'Initialise the string with the address entered into box sAddress = InputBox("Please enter the name of the recipient" & vbCr & "CONVENTION = firstname . surname@thiscompany.co.uk", "Send To") 'If the user doesn't enter an address then exit the sub. If sAddress = "" Then Exit Sub ' SELECT THE SHEET NAME Sheets("site 1").Select ' change name Range(Range("A1"), Range("g49").End(xlUp)).Select Selection.Copy ' if you have multi formatted colums etc ( ie various widths etc) then it is better to create a blank master and load that and then paste to that Workbooks.Add ' paste the selection Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Application.CutCopyMode = False ActiveWorkbook.SendMail Recipients:=sAddress, Subject:="site 1 cost pro", ReturnReceipt:=False MsgBox "Your email has been sent to" & vbCr & sAddress & vbCr & "", , "MESSAGE" ActiveWindow.Close ' at this point select no to msgbox and then swithback to original sheet Sheets("printing").Select ' change name Range("A1").Select End Sub [ This Message was edited by: keithkemble on 2002-03-12 13:24 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|