Link to home
Start Free TrialLog in
Avatar of mikes6058
mikes6058

asked on

change to macro coding to send multiple lines

HI

Attached is a spreadsheet with a number of rows containing basic trading terms for a number of companies (made up). Column T contains an email address.

The button on the sheet has a macro assigned to it which is designed to split the top row of headings and each individual separate row and then send those two rows to the relevant email address in column T in a separate excel worksheet.

However I would like to alter the macro so that if the same email address appears in multiple rows then each of these rows is collated together along with the top row of column headings into one spreadsheet and then sent as one email attachment to that email address.

Based on the example (example sheet) attached I would expect a workbook containing the following to be sent to robmarr789@gmail.com (1 email to be sent only)

      



Would anyone be able to alter the coding in the macro to this?

Thanks Rob
Copy-of-DIRECT-Central-Terms-encrypted.x
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

I could not find a macro
Avatar of mikes6058
mikes6058

ASKER

see attached
ASKER CERTIFIED SOLUTION
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That's brilliant, exactly what I wanted it to do.

Now I need exactly the same code to be applied to the attached sheet only with the following differences....

1. Only send columns in the range A:W - do not include any columns after this.
2. Change it so it sends to the email address in column W
3. Do not collate and send rows where column X contains (RESOLVED) or column Y contains (INTERNAL QUERY)

Thanks
Master-Query-Log.xlsm
I think for condition 3 a different approach should be adopted. You should open a new question.
Excellent solution.

I have opened a new question for the next steps (see below).

https://www.experts-exchange.com/questions/28656182/macro-to-send-certain-range-and-to-filter-depending-on-value.html
Great work