+ Reply to Thread
Results 1 to 7 of 7

Cannot write VBA code - spaces deleted

  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 10:38 AM. Reason: Mark solved

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    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?
    Remember what the dormouse said
    Feed your head

  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 Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    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.

  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 10:36 AM. Reason: Typo

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Cannot write VBA code - spaces deleted

    Glad it helped.

  7. #7
    Registered User
    Join Date
    01-11-2013
    Location
    Illinois
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Cannot write VBA code - spaces deleted

    Still a helpful post. Thanks.

+ Reply to Thread

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.6.0 RC 1