Closed Thread
Results 1 to 4 of 4

VBA automatically updating variable names

  1. #1
    Mike T
    Guest

    VBA automatically updating variable names

    I defined 2 functions in the same module. One function use lower case 'x' as
    the arguement and the other uses upper case 'X' as the arguement(see below).
    VBA automatically changes one of the arguements to match the other. It does
    the same thing even if I put each of the functions in different modules.

    Function fun1(x As Integer)
    End Function

    Function fun2(X As Integer)
    End Function

    Can someone please explain this and if I can prevent it? Thanks


  2. #2
    Luke Alcatel
    Guest

    Re: VBA automatically updating variable names

    Be more imaginative and use much more descriptive and unique names for your
    function parameters.

    Luke

    "Mike T" <Mike [email protected]> wrote in message
    news:[email protected]...
    > I defined 2 functions in the same module. One function use lower case 'x'

    as
    > the arguement and the other uses upper case 'X' as the arguement(see

    below).
    > VBA automatically changes one of the arguements to match the other. It

    does
    > the same thing even if I put each of the functions in different modules.
    >
    > Function fun1(x As Integer)
    > End Function
    >
    > Function fun2(X As Integer)
    > End Function
    >
    > Can someone please explain this and if I can prevent it? Thanks
    >




  3. #3
    NickHK
    Guest

    Re: VBA automatically updating variable names

    Mike,
    Considering your argument names are meaningless, you could try another
    letter of the alphabet.

    NickHK

    "Mike T" <Mike [email protected]> wrote in message
    news:[email protected]...
    > I defined 2 functions in the same module. One function use lower case 'x'

    as
    > the arguement and the other uses upper case 'X' as the arguement(see

    below).
    > VBA automatically changes one of the arguements to match the other. It

    does
    > the same thing even if I put each of the functions in different modules.
    >
    > Function fun1(x As Integer)
    > End Function
    >
    > Function fun2(X As Integer)
    > End Function
    >
    > Can someone please explain this and if I can prevent it? Thanks
    >




  4. #4
    Zack Barresse
    Guest

    Re: VBA automatically updating variable names

    Hi Mike,

    Why not try the popular hungarian-type notation? Here are some examples ...

    Type - Variable Name
    ----------------------------------
    Boolean blnWasCreated
    String strFileName
    Long lngRow
    Range rngFilter
    Variant varUniqueArray

    HTH

    Regards,
    Zack Barresse



    "Mike T" <Mike [email protected]> wrote in message
    news:[email protected]...
    > I defined 2 functions in the same module. One function use lower case 'x'

    as
    > the arguement and the other uses upper case 'X' as the arguement(see

    below).
    > VBA automatically changes one of the arguements to match the other. It

    does
    > the same thing even if I put each of the functions in different modules.
    >
    > Function fun1(x As Integer)
    > End Function
    >
    > Function fun2(X As Integer)
    > End Function
    >
    > Can someone please explain this and if I can prevent it? Thanks
    >




Closed 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