Consulting

Results 1 to 10 of 10

Thread: Rookie: Working with Private Subs

  1. #1
    VBAX Newbie
    Joined
    Jun 2015
    Posts
    4
    Location

    Rookie: Working with Private Subs

    Hi Folks,

    I am watching some excel videos on udemy, and I came across this issue. Everytime I hit the f5 button it opens a macro window and asking me to load a macro. This is while working on a private worksheet. Any insight on how to fix this?

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    ?

    I used to have the same problem with the Caps lock key. Then I removed it from my keyboard. No more TALKING IN ALL CAPS FOR ME.

    In other words, I don't see what problem you are having.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Newbie
    Joined
    Jun 2015
    Posts
    4
    Location
    Quote Originally Posted by SamT View Post
    ?

    I used to have the same problem with the Caps lock key. Then I removed it from my keyboard. No more TALKING IN ALL CAPS FOR ME.

    In other words, I don't see what problem you are having.

    My my compile and debug button does not work when there's an actual code in the screen.

  4. #4
    VBAX Expert mperrah's Avatar
    Joined
    Mar 2005
    Posts
    744
    Location
    Do you have selection within the start and end of a sub in the VB editor?
    if your cursor is below the End Sub line you will be prompted for which sub you wish to run

  5. #5
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,728
    Location
    Also, if the cursor is in a sub or function that requires parameters, F5 will ask for the sub to run since you can't run that one
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  6. #6
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    If there are no blatant errors in your code then you will not see any feedback from Debug >> Compile. Misspell a variable name and try it.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  7. #7
    VBAX Newbie
    Joined
    Jun 2015
    Posts
    4
    Location
    Quote Originally Posted by SamT View Post
    If there are no blatant errors in your code then you will not see any feedback from Debug >> Compile. Misspell a variable name and try it.
    I think it has something to do with Application.EventsEnabled = True...

    Its only in the events sheets and not a module.

  8. #8
    VBAX Newbie
    Joined
    Jun 2015
    Posts
    4
    Location
    I know theres no errors. But usually it lets me go into step in mode but it wont even do that. I have reset this project and still for the life of me cant figure out why its doing it. There are a few sheets where this works correctly but not all the time.

  9. #9
    VBAX Expert mperrah's Avatar
    Joined
    Mar 2005
    Posts
    744
    Location
    You can post your workbook by clicking "goadvanced" then we can have at look at this possible issues code wise.

  10. #10
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Maybe I'm missing something, but if you're talking about being in the VBE and pressing F5 brings up a dialog titled "Macros", then your cursor isn't in a sub routine, which means Excel doesn't know what routine you want to run, hence the dialog box. You'll also see this if the sub routine your cursor is in takes parameters as well. You must sepecify any parameters and Excel can't assume them.

    I'd recommend using the Immediate Window (CTRL+G). You can just type in the name of the routine and press Enter. Whatever you press Enter on it will execute that line of code.

Posting Permissions

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