Consulting

Page 2 of 2 FirstFirst 1 2
Results 21 to 32 of 32

Thread: All Office Application Events

  1. #21
    Site Admin
    The Princess
    VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    Does the following statement make sense?

    When a macro is named with the same name as an internal command, the macro runs in place of the command.
    ~Anne Troy

  2. #22
    Administrator
    VP-Knowledge Base VBAX Master
    Joined
    Jan 2005
    Location
    Porto Alegre - RS - Brasil
    Posts
    1,219
    Location
    I think so.
    Best Regards,

    Carlos Paleo.

    To every problem there is a solution, even if I dont know it, so this posting is provided "AS IS" with no warranties.

    If Debugging is harder than writing a program and your code is as good as you can possibly make
    it, then by definition you're not smart enough to debug it.




    http://www.mugrs.org

  3. #23
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    When a macro is named with the same name as an internal command, the macro runs in place of the command.
    It makes sense in Word but the same facility is not in other Office programs - least I couldn't swear for all of them but I think it's only Word.
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  4. #24
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    Thanks, Tony.

    Another question....

    I have private sub and public sub.

    I have function.

    WTF is Type??
    ~Anne Troy

  5. #25
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,938
    Location
    Anne,

    I would not say you were obligated to describe IF statements in the same topic as WITH statements. Two very seperate and different methods. Or did I miss something? (Just found this thread.)

    Re: Ken's file, I need to get it up. Did you take a look at it Anne? Is it helping?

    When a macro is named with the same name as an internal command, the macro runs in place of the command.
    I believe this will give you an error in Excel, at least it does for me. You should get a compile error that says, "Expected identifier."

  6. #26
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    I'm not using the file. I'm simply providing a link to it.

    I've decided to scratch specific references to with and ifs and such in each of the procedures we're providing. BUT, I am gonna provide a brief description of those kinds of statements.

    In other words, I was gonna say "the following procedure uses blah blah; refer to the appendix". I've decided to just say in the beginning something like "for a brief explanation on many of the ...., see the appendix."
    ~Anne Troy

  7. #27
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    If I'm following this, Type is basically a definition of a Data Structure.

    Say you are working with information about a person. You could have lots of variables - name, age, email addy, inside leg, whatever. Or you could declare a Type:

    [VBA]Type PersonDetails
    Name as String
    Age As Long ' To allow for modern miracles
    EMail as String
    InsideLeg as Integer
    End Type
    [/VBA]
    and then you could declare a variable of that Type instead of one of the built in types:

    [VBA]Dim Tony as PersonDetails[/VBA]

    and you would have access to all of the details in a kind of obvious way:

    [VBA]Tony.Name = "Tony"
    Tony.Age = 52[/VBA] etc.

    or you could have an array of friends and want the same info on all of them:

    [VBA]Dim Friend(1 to 100) as PersonDetails

    Friend(1).Name = "Anne"
    Friend(2).Name = "Annie"
    Friend(3).Name = "Dreamboat"[/VBA]

    I could go on ... :rofl
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  8. #28
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    I see that EYE am not in that list of friends??
    What's up with that!!!???

    Thanks!!
    ~Anne Troy

  9. #29
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location


    Anne, I noticed that he didn't put the End Sub line in... maybe you're the first one off the screen.
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  10. #30
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    There! I fixed his code!
    ~Anne Troy

  11. #31
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location


    And here you say you know nothing about VBA!
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  12. #32
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    You see, you DO know code

    I was writing code for you - and I just guessed that you might have some friends with those names. You can use your real friends if you like.
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

Posting Permissions

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