Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default date display from excel in word

Hello all,

I'm working on a macro wich must look for people,dates,currency.. and so on
in a big table, so the selected data are placed in a smaller table, from
wich a word macro (activated by a cmdbutton in excel) uses tha data to make
a mail merge. The selected data is used to write 25-50 letters a time
without having to type :-)

All works well, and as it should, only the date (as in: 12/05/2006) is
displayed as a number ( wich excel uses..) so i don't have date's in my
letters but things as "38849". Not very usefull.. can anybody tell me how
to display the excel date as a date in word ?

I already tried with automated copy-paste, that works, but only very
slowly. I also tried to automate copy and paste in a texbox in excel..that
doesn't work, because i can't paste in a texbox..any ideas ?

tia
sven

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default date display from excel in word

In either the small or large table, select the cells with the dates in them
and run:

Sub datefixer()
For Each r In Selection
v = Format(DateValue(r.Value), "mm/dd/yyyy")
r.NumberFormat = "@"
r.Value = v
Next
End Sub

This converts the anys into strings with the specified date format. They
should import into Word just fine.
--
Gary's Student
gsnu200705


"[sven]" wrote:

Hello all,

I'm working on a macro wich must look for people,dates,currency.. and so on
in a big table, so the selected data are placed in a smaller table, from
wich a word macro (activated by a cmdbutton in excel) uses tha data to make
a mail merge. The selected data is used to write 25-50 letters a time
without having to type :-)

All works well, and as it should, only the date (as in: 12/05/2006) is
displayed as a number ( wich excel uses..) so i don't have date's in my
letters but things as "38849". Not very usefull.. can anybody tell me how
to display the excel date as a date in word ?

I already tried with automated copy-paste, that works, but only very
slowly. I also tried to automate copy and paste in a texbox in excel..that
doesn't work, because i can't paste in a texbox..any ideas ?

tia
sven


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default date display from excel in word

Debra Dalgleish posted this:

There's an article on the Microsoft web site that might help you:

Answer Box: Numbers don't merge right in Word
http://office.microsoft.com/en-ca/as...164951033.aspx

And if you prefer the old Mail Merge helper, Word MVP Suzanne Barnhill
has instructions he

http://sbarnhill.mvps.org/WordFAQs/C...ngWord2002.htm

about half way down the page.


"[sven]" wrote:

Hello all,

I'm working on a macro wich must look for people,dates,currency.. and so on
in a big table, so the selected data are placed in a smaller table, from
wich a word macro (activated by a cmdbutton in excel) uses tha data to make
a mail merge. The selected data is used to write 25-50 letters a time
without having to type :-)

All works well, and as it should, only the date (as in: 12/05/2006) is
displayed as a number ( wich excel uses..) so i don't have date's in my
letters but things as "38849". Not very usefull.. can anybody tell me how
to display the excel date as a date in word ?

I already tried with automated copy-paste, that works, but only very
slowly. I also tried to automate copy and paste in a texbox in excel..that
doesn't work, because i can't paste in a texbox..any ideas ?

tia
sven


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set the day date in excel to display 1st, 2nd, etc...? Spaced out. Excel Discussion (Misc queries) 2 January 20th 09 01:44 PM
Display symbols in embedded excel sheet in word df_newtovba[_2_] Excel Discussion (Misc queries) 0 December 23rd 08 08:49 PM
Excel Date Display? Naveeddil Excel Discussion (Misc queries) 8 May 19th 08 06:19 PM
display extension for date in excel phil Excel Discussion (Misc queries) 8 November 14th 06 08:24 PM
Display Word Paragraphs in Excel??? quartz[_2_] Excel Programming 2 January 10th 05 07:39 PM


All times are GMT +1. The time now is 09:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"