PDA

View Full Version : Macro - Mail every worksheet using A1 as address



sknight22
05-17-2018, 07:30 AM
Hello


I am using the below code to send multiple sheets to email addresses in cell a1. The problem I have is that one column on the sheet is formatted as time but when the macro is run it changes the time to the wrong format (see below for example - original time in blue & what the macro changes it to in red) when stepping through the code I can see the change happens when it gets to ".Cells.PasteSpecial xlPasteValues"


can anyone help me? im stuck


LOADING TIME
13:00:00
15:00:00
16:00:00




LOADING TIME
0.541666667
0.625
0.666666667

**only problem is the site wont let me post my code?

Kenneth Hobs
05-17-2018, 08:20 AM
Welcome! I have not heard of no code being allowed. URL's are not allowed until you have 5 posts.

Post code between code tags. Click the # icon to insert the tags.

Just do a paste to keep the format?

Most use htmlBody in Outlook object to convert a range to html. Ron de Bruin has some examples on his site.

sknight22
05-17-2018, 08:37 AM
Hello

Thanks, yes it does say URLs, my apologies but I cant see any urls in my code so im confused.

The code im using is from Ron de Bruin site

Norie
05-17-2018, 09:37 AM
Kenneth

You can find the code over here (https://www.mrexcel.com/forum/excel-questions/1055625-mail-every-worksheet-using-a1-address.html).

sknight22
05-18-2018, 07:50 AM
sorry - didnt realise I was doing something wrong