Attached are two excel workbooks "master_query_log" and "query1".
Currently when the "import" button in the master query log is clicked it will allow the user to select the relevant query file e.g. "query1". Once selected the information will automatically be copied and pasted into the bottom row of the the master query log under the appropriate column headings.
I would like to add another step to the macro.
When the "import" button is clicked and the file is selected. I would also like the macro to automatically send an email to the email address is column F of the master query log.
The body of the email will include the following.
Member Name: RS Industrial Services Limited
Supplier Name: Guardsman Ltd
Value on Query: £247.63
Query Ref.: Q327
Supplier Invoice No.: 46/132603
Date THS HQ Logged Query: 14/04/2015
Subject: Invoice Query Acknowledgement
Note this includes information added once the sheet has been pasted into the master query log.
e.g.
UID = Query Ref.:
Date THS HQ Logged Query: = HQ Input Date
If any one is able to add the coding to the sheet and reattach that would be great.
Everything works up until the final stage where the email does not send automatically.
At this stage a command box appears stating "would you like to email the report?"
when I select "yes" the email template then opens. The subject and body text are all correct.
However the email address field is populated with a "0" instead of the appropriate email address from column "F". I was hoping the email would automatically be sent to the appropriate email address without having to send it manually.
Thanks, that works for the email address but I do still have to click the send button to send the email. Is there a way of sending the email automatically?
Roy Cox
In the notes of the macro you will see instructions. Basically replace .Show with .Send
7).Value, "short date")
'/// show message for checking
.display
'/// use next line to simply send without checking
' .Send
Roy Cox
Sorry I didn't realise that you didn't know about this. Notice the text is green and the apostrophe before it. This makes it a comment and will not run. You need to add an apostrophe before .Show and remove the one before .Send.
mikes6058
ASKER
Spot on! Sorry I really am a novice when it comes to VBA. I'd really like to learn the basics. Do you know of any good resources to use as a start?
Also I've just opened another Q if your'e interested (see below)
I'm at the day job just now.
I'll take a look later. It should be reasonably simple. Are you using OutLook?