+ Reply to Thread
Results 1 to 5 of 5

VBA Module window problem

  1. #1
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    VBA Module window problem

    Hey all,

    I am having problems entering code into the module window. Eg I start to write a new sub, obviously the first thing you write is the word Sub, but this is where it gets strange. When I press the space bar, the curser jumps back to where it was and the word "Sub" then it shows up in red text as if there is an error. But of coarse that can't be the case b/c I have not even written any code yet. No matter how many times I try to put in a space it always jumps back. So you can see that I cannot write any code right now.

    Anyone know what this is and how to fix it?
    Last edited by JapanDave; 11-19-2011 at 02:04 AM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,288

    Re: VBA Module window problem

    Hi JapanDave,

    Do you have a Sub above where you are typeing Sub? I'm thinking you are trying to put a Sub inside a Sub and that isn't allowed. Also, perhaps you don't have an End Sub to stop the above Sub?

    Also - look at Tools -> Options to see if things make sense there.

    It almost seems like your "Space" has been replaced by an ENTER character. Do you have some keyboard macro running that converts a space to a return?

    Is there a chance the Ctrl key is stuckk on your keyboard making a space different? See
    http://www.cpearson.com/excel/vbashortcutkeys.htm
    Last edited by MarvinP; 11-19-2011 at 01:18 AM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: VBA Module window problem

    Quote Originally Posted by MarvinP View Post
    Hi JapanDave,

    Do you have a Sub above where you are typeing Sub? I'm thinking you are trying to put a Sub inside a Sub and that isn't allowed. Also, perhaps you don't have an End Sub to stop the above Sub?
    Hey Marvin,

    It is a new workbook and a new module.

    First time I saw this was when I was editing code from someone else. But I don't have that workbook any more as it is deleted from my PC.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,288

    Re: VBA Module window problem

    I've added 2 edits to my original post. Ctrl key stuck? Also re-read my first post.

    In Word you can create substitute words that tricks people. I believe it is using AutoCorrect feature. I don't think Excel has this but I wonder if your keyborad is programmable and is doing something like it?

    Is the AutoCorrect part of the spell checker?

  5. #5
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: VBA Module window problem

    Marvin there is definitively something funky going on. And it could possibly be a macro running and doing something. Why I say this is b/c it started when I was editing a macro that someone else had made.

    But I may have fixed things, I went into the downloads folder and deleted all the excel files there(That workbook I was talking about was still there) and when I started to write a sub again , things were back to normal. Maybe I downloaded a bad macro and it was doing funny things? Anyway it seems to be fixed now.

    Thanks for the help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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