+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    03-16-2010
    Location
    Scotland
    MS-Off Ver
    Excel 2007
    Posts
    2

    Cannot write VBA code - spaces deleted

    I am using Excel 2007. I am recording macros and then trying to modify the VBA code. But when I try to modify the code, and type my own code, whenever I type a space, it is automatically deleted. I can write out a line and then enter all the spaces manually and it works but obviously this isnt convenient.

    I think it might have something to do with the security settings but I have enabled everything as far as I can see.

    Has anyone any ideas on how to fix this unusual and incredibly annoying problem.

    Thanks.
    Last edited by romperstomper; 06-30-2011 at 11:38 AM. Reason: Mark solved

  2. #2
    Forum Moderator romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Alibi
    MS-Off Ver
    All
    Posts
    8,262

    Re: Cannot write VBA code - spaces deleted

    Seems to be an occasional bug in 2007 - does clicking the Design Mode button (on the Developer tab) help?
    So long, and thanks for all the fish.

  3. #3
    Registered User
    Join Date
    03-16-2010
    Location
    Scotland
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Cannot write VBA code - spaces deleted

    Yes that fixes it. Thanks a lot - that wouldn't have occured to me. I had never clicked on it before but Excel must have automatically selected it on the occasions when I didn't have this problem.

  4. #4
    Forum Moderator romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Alibi
    MS-Off Ver
    All
    Posts
    8,262

    Re: Cannot write VBA code - spaces deleted

    It's not normally necessary (that behaviour should not occur) but it seems to fix the problem usually when it does occur.
    So long, and thanks for all the fish.

  5. #5
    Registered User
    Join Date
    09-27-2010
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    1

    Smile Re: Cannot write VBA code - spaces deleted

    Quote Originally Posted by romperstomper View Post
    Seems to be an occasional bug in 2007 - does clicking the Design Mode button (on the Developer tab) help?
    I use VBA occasionally, and I could not find ANY answers for fixing this ANNOYING defect until I reluctantly stumbled upon this post...

    Not only does this seem to be an issue in Office 2007, but also in 2010!

    THANK YOU FOR THIS RESPONSE!!!

    -Mike
    Last edited by prezzhax; 06-30-2011 at 11:36 AM. Reason: Typo

  6. #6
    Forum Moderator romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Alibi
    MS-Off Ver
    All
    Posts
    8,262

    Re: Cannot write VBA code - spaces deleted

    Glad it helped.
    So long, and thanks for all the fish.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0