+ Reply to Thread
Results 1 to 7 of 7

having user input info, want to check before pasting

  1. #1
    Registered User
    Join Date
    02-27-2009
    Location
    ma
    MS-Off Ver
    Excel 2003
    Posts
    35

    having user input info, want to check before pasting

    i am writing a program that asks the user for an input and sets it equal to a variable.

    i want to look thru a column for this variable, if it is not in it, then paste it at the end of the column. if it is in already, throw up a dialog box saying its already used and exit the sub.


    i dont know how to set up this kind of thing up???

    vlookup in combination with an if statement?

    any help would be great.

    thanks

    nick
    Last edited by roth_nj; 03-19-2009 at 02:27 PM.

  2. #2
    Registered User
    Join Date
    02-27-2009
    Location
    ma
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: having user input info, want to check before pasting

    the following code is what im thinking
    i put in the word "thing"
    i dont know how to say if "any value in column A on sheet A" equals
    and Location is my variable




    Please Login or Register  to view this content.

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: having user input info, want to check before pasting

    Hello roth_nj,

    You can use the Find function for range. This will either return the address of the cell of the search value or nothing. You can use anIf ... Then to set the value like this...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    02-27-2009
    Location
    ma
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: having user input info, want to check before pasting

    thanks, that helps me out.

    ive done C++ programing before but this is my first program with excel. i have no problem figuring stuff out, i just dont really know most of the functions available

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: having user input info, want to check before pasting

    Hello roth_nj,

    To find information on properties, methods, and events for VBA objects use the Object Browser. To view the Object Browser, open the VBE from Excel using ALT+F11 then press F2. Use the VBA help files for more information about arguments and syntax. Microsoft also has online help for VBA. To learn about the functions that are available in VBA you should buy a book on VBA.

  6. #6
    Registered User
    Join Date
    02-27-2009
    Location
    ma
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: having user input info, want to check before pasting

    for whatever reason on my computer here at work, the help isnt working. i go to type something in and its frozen. its works in excel though.

    and i bought vba for dummies and am about halfway thru reading it

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: having user input info, want to check before pasting

    Hello roth_nj,

    Here is a link you may find helpful on VBA programming resources.

    http://support.microsoft.com/kb/163435

+ 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