Results 1 to 13 of 13
  1. #1
    Star Lounger
    Join Date
    Mar 2001
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    navigating in vb / Alt F8 (97)

    I have a couple of macros in xl. If I Alt F8 I get a list of them and can edit them in vb. In VB if I'm looking at the code for a macro named "aaa", what's the quickest way to view the code of another macro "bbb". At the moment I just switch back to XL, alt F8, find macro "bbb" from the list, and click the edit button.

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: navigating in vb / Alt F8 (97)

    If those macro's are in the same module, you can use the dropdowns at the top of the window. Otherwise you can use the project explorer window to navigate the projects and their components.

    Alternatively, you can use the Find option (Edit, Find or control-F) to search all objects in a project (a workbook) for the name of the sub (macro).
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: navigating in vb / Alt F8 (97)

    As an addition what Jan Karel has said, if your "aaa" has a line that calls "bbb", you can just place the cursor somewheer in "bbb" on the line and press Shift-F2. That should take you to the first line of code for sub "bbb".

    This works even if you have a proc name in the immediate window, just place the cursor in the proc name and use Shift-F2.

    Ctrl-Shift-F2 brings you back to where you were.

    Andrew C.

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: navigating in vb / Alt F8 (97)

    Hi Andrew,

    <<shift-F2>>

    Didn't know that one, neat!
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  5. #5
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: navigating in vb / Alt F8 (97)

    < Didn't know that one >

    That's a rarity indeed.

    It is convenient, especially as it works across modules.

    Andrew

  6. #6
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: navigating in vb / Alt F8 (97)

    If you look at the attached file, it is not really straighforward that shift F2 does what you stated. Shows why I missed it...
    Attached Files Attached Files
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  7. #7
    Star Lounger
    Join Date
    Mar 2001
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: navigating in vb / Alt F8 (97)

    ctrl F certainly helps.

    But it's a goddamn confusing environment for the beginner. I mean most of my macros are simply recordings. And VB automatically it seems assigns them to separate modules. So as I've said , by pressing alt f8 in xl I can see a nice list, this same list does not then exist in VB. Also I can't say that I find VB help v helpful. There seems to be little in the way of an "intro to VB". It seems geared to experts only. Anyway I guess I'll keep trying to get my head around it.

  8. #8
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: navigating in vb / Alt F8 (97)

    Jan,

    Thanks for that file - will come in handy.

    < Procedure Definition > could be a little confusing as a discription of what Shift-F2 actually does.

    regards

    Andrew

  9. #9
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: navigating in vb / Alt F8 (97)

    And of course you can get help out here...

    BTW: there is a number of great books on VBA, here is a couple:

    Excel 2000/2002 VBA Programmers Reference. Stephen Bullen, John Green, Rob Bovey, Robert Rosenberg Wrox Press.

    Excel 2000 VBA Power Programming. John Walkenbach.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  10. #10
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: navigating in vb / Alt F8 (97)

    There's nothing to stop you grouping you macros all in the same module: simply cut and paste (making sure you change the module name to something meaningful). <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    FWIW it may help a great deal to pick apart what has been recorded and see how that has converted what you have done to a particular jargon. That, as well as reading the threads posted here and testing the code posted on your own machine, may give you a clearer understanding of what the "help" files are talking about.
    Gre

  11. #11
    Star Lounger
    Join Date
    Mar 2001
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: navigating in vb / Alt F8 (97)

    dem dare modules arent' easy to rename are they. How do I do it...

  12. #12
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: navigating in vb / Alt F8 (97)

    You can change module names in the properties window (if it is not on view goto the View Menu - in the VB editor - and select Properties Window). Select the appropriate module, and in the properties window overwrite the old name with the new.

    Andrew C

  13. #13
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: navigating in vb / Alt F8 (97)

    Should be two critters on the left hand side of your VBE: the top one is called the Project Explorer and the bottom one is called the Properties Window.
    Identify the target module in the Project Explorer.
    Go down to the Properties Window. Most of it will be taken up by two columns.
    Select the line with "Name" on the left hand side, put your cursor in the right hand side, and edit away to your heart's content!
    Gre

Posting Permissions

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