News, tips, advice, support for Windows, Office, PCs & more
Home icon Home icon Home icon Email icon RSS icon

We're community supported and proud of it!

  • Spaces !

    Viewing 2 reply threads
    • Author
      • #2306221
        AskWoody Lounger

        It is easy to TRIM spaces, but I have the opposite problem !

        I want to write 4 spaces into a worksheet cell – this is for subsequent formatting purposes.

        However using something like:

        Range(<address>).value = ”    “

        Results in an empty cell.

        How can I stop this unwanted “trimming” ?



      • #2306403
        Paul T
        AskWoody MVP

        First, you should not use spaces to format cells IMO. Excel has plenty of defined formats and customs ones are easy to add.

        To put text into a cell without modification you need to put an apostrophe in front.
        e.g. Range(<address>).value ="'    "

        cheers, Paul

        1 user thanked author for this post.
      • #2307032
        AskWoody Lounger

        Thanks for the solution Paul.
        I do know about Excel formatting – when I said “subsequently” I should maybe have said that, later, the cell’s contents are exported into another application that does need spaces to display correctly.

        1 user thanked author for this post.
    Viewing 2 reply threads

    Please follow the -Lounge Rules- no personal attacks, no swearing, no politics or religion.

    Reply To: Spaces !

    You can use BBCodes to format your content.
    Your account can't use Advanced BBCodes, they will be stripped before saving.