Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with formatting of paste?

Status
Not open for further replies.

GoDawgs

MIS
Apr 1, 2002
670
US
I might be reaching here, but I'll tell you my problem just in case I'm not. I've got an Excel file right now that is linked to an Access query. This file is refreshed daily and needs to be emailed out every day...only problem is we don't want it to be an attachment, it needs to be in the body of the email. Not a problem so far, I've set up some code to copy and paste to email and send it...the one problem I'm having is that the data is in a table-like format (column headers, data) and when I paste to the email it comes in all jumbled up when it needs to be in pretty much exactly the same format as in Excel (basically I just need all the numbers to line up properly). Anyway, I've tried copying and pasting from code from Word as well, but that didn't work either...just wondering if anyone has any ideas on this. Hope that makes sense, thanks for any help.

Kevin
 
Just the one ;-)
Could you add a line break (Chr(13)) at the point where you want to create the next line
HTH
~Geoff~
[noevil]
 
Yeah, I've started to try and paste one at a time and keep them lined up (i'm only pasting about 8 numbers in the end, so not a big deal)...so I'm going to try and add tabs and line breaks on my own...thanks for the idea, hopefully it'll work, I've got to look up the character codes.

Kevin
 
Carriage Return = chr(10)
Line Break = Chr(13)

eg "This is some sample Test" & chr(10) & "This will appear on a new line"

easiest way to get a list of allchar codes is to put
=Char(Row())
in A1 and drag down - theres only ~256 of 'em
HTH
~Geoff~
[noevil]
 
Got it, thanks a bunch Geoff, much appreciated, made my life a lot easier...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top