Hi,

I want to add some extra spaces after text in a cell so
the cell expands. The following does not work:

Selection.Typetext " "

or

Selection.InsertSymbol Font:="Garamond", _
CharacterNumber:=32, Unicode:= _
True
Selection.InsertSymbol Font:="Garamond", _
CharacterNumber:=32, Unicode:= _
True
Selection.InsertSymbol Font:="Garamond", _
CharacterNumber:=32, Unicode:= _
True

The code produces thre extra spaces, but the cell does
not expand. If I type extra letters, for example
Selection.TypeText "123", then the cell expands.

/ Ulf

Re: Expand cells by Klaus

Klaus
Mon Aug 30 02:57:48 CDT 2004

Hi Ulf,

You could use non-breaking spaces ChrW(&HA0), but it would likely be
"cleaner" to set the column width properly.

Regards,
Klaus



Re: Expand cells by Ulf

Ulf
Mon Aug 30 03:11:34 CDT 2004

Hi Klaus,
Thnaks for your solution. I tried to record using non-
breaking spaces, but the macro recorded only " ". I
will use ChrW(&HAO) for now, and will try to make
it "cleaner" when time allows.

/ Ulf


>-----Original Message-----
>Hi Ulf,
>
>You could use non-breaking spaces ChrW(&HA0), but it
would likely be
>"cleaner" to set the column width properly.
>
>Regards,
>Klaus
>
>
>.
>

Re: Expand cells by Jezebel

Jezebel
Mon Aug 30 03:35:48 CDT 2004

Don't try to create macros using the recorder. It's only worthwhile purpose
is to give you a hint as to what the macro code should look like ... but the
code it produces is uniformly AWFUL.



"Ulf Nilsson" <anonymous@discussions.microsoft.com> wrote in message
news:27ad01c48e68$f6b84170$a501280a@phx.gbl...
> Hi Klaus,
> Thnaks for your solution. I tried to record using non-
> breaking spaces, but the macro recorded only " ". I
> will use ChrW(&HAO) for now, and will try to make
> it "cleaner" when time allows.
>
> / Ulf
>
>
> >-----Original Message-----
> >Hi Ulf,
> >
> >You could use non-breaking spaces ChrW(&HA0), but it
> would likely be
> >"cleaner" to set the column width properly.
> >
> >Regards,
> >Klaus
> >
> >
> >.
> >



Re: Expand cells by Klaus

Klaus
Mon Aug 30 04:01:21 CDT 2004

> Don't try to create macros using the recorder. [...]

In fact, it does work in the current case.

The only problem is that the VBA editor can't display formatting
characters.
It shows
Selection.TypeText = " "
but actually inserts a non-breaking space.

The macro recorder uses the characters themselves if they are in the
Windows code page (1252 usually), and ChrW(####) if they aren't.
The non-breaking space is in code page 1252.

Things will hopefully get simpler once the VBA editor uses Unicode...

Regards,
Klaus



Re: Expand cells by Jezebel

Jezebel
Mon Aug 30 04:42:51 CDT 2004

Better still, the OP might explain the point of the exercise ... since
adding spaces to the end of a cell doesn't, in itself, make any difference
at all to the appearance of the document ... as you suggested earlier,
setting the column width is probably the intention.


"Klaus Linke" <info@fotosatz-kaufmann.de.no.junk> wrote in message
news:eGoIk$mjEHA.3876@TK2MSFTNGP15.phx.gbl...
> > Don't try to create macros using the recorder. [...]
>
> In fact, it does work in the current case.
>
> The only problem is that the VBA editor can't display formatting
> characters.
> It shows
> Selection.TypeText = " "
> but actually inserts a non-breaking space.
>
> The macro recorder uses the characters themselves if they are in the
> Windows code page (1252 usually), and ChrW(####) if they aren't.
> The non-breaking space is in code page 1252.
>
> Things will hopefully get simpler once the VBA editor uses Unicode...
>
> Regards,
> Klaus
>
>