News, tips, advice, support for Windows, Office, PCs & more. Tech help. No bull. We're community supported by donations from our Plus Members, and proud of it
Home icon Home icon Home icon Email icon RSS icon
  • Spaces !

    Posted on WSMartinM Comment on the AskWoody Lounge
    • This topic has 2 replies, 2 voices, and was last updated 1 month ago.
    Viewing 2 reply threads
    • Author
      • #2306221 Reply
        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 Reply
        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 Reply
        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, and politics/religion are relegated to the Rants forum.

    Reply To: Spaces !

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