+ Reply to Thread
Results 1 to 6 of 6

Help with Invalid Qualifier error

  1. #1
    Registered User
    Join Date
    10-27-2012
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    2

    Help with Invalid Qualifier error

    Hi I'm new to vba programming and I'm trying to make a very simple macro which swaps values
    The macro calls a form which looks like this
    Please Login or Register  to view this content.
    But when I run it, after i put the values into my text boxes(txtCell1 and txtCell2) and hit submit, i get the Message: "Compile Error: Invalid Qualifier, can someone please help me figure out what I'm doing wrong

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Help with Invalid Qualifier error

    In SwapValues, cell1 and cell2 are defined (in the subroutine header) as string variables. As such, they don't have properties ... so .Value is an invalid qualifier.

    Cell1 and Cell2 would have to be passed as ranges.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Help with Invalid Qualifier error

    cell1 and cell2 are string variables and have no properties like Value.

    Just remove .Value where you have it after cell1 or cell2.

  4. #4
    Registered User
    Join Date
    10-27-2012
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    2

    Re: Help with Invalid Qualifier error

    Thanks for the help, problem was easily fixed

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Help with Invalid Qualifier error

    You're welcome.


    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Help with Invalid Qualifier error

    @ nickwhan

    Welcome to the forum.

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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