How to keep date from wrapping between month and day

D

David

I have written a macro to allow the user to enter dates in mmddyy
format and then hit a hotkey to expand the dates into January 1, 2006
format. However, if the date is near the end of a line it can separate
the month from the day because of word wrap. I know that if I am
entering text from the keyboard, I can use control-shift-space to make
a "sticky space," but I can't get this to work in VBA. Currently the
line involved is:

If d$(1) + d$(2) = "01" Then mm$ = "January "

I think I would want to replace "January " with "January" + chr$(??),
but I can't find any reference to this.

Thanks in advance for any tips on how to do this.

David
 
G

Graham Mayor

It's a non breaking space you are looking for
"January" & Chr(160)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
D

David

Thanks for the replies. 160 is exactly what I was looking for. I see
now that the term "sticky space" is only the name on Mac. My coworkers
are going to be very, very happy.

Thanks again,

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top