Closed Thread
Results 1 to 4 of 4

inputbox validation

  1. #1
    Registered User
    Join Date
    04-22-2010
    Location
    Greece
    MS-Off Ver
    Excel 2007
    Posts
    50

    inputbox validation

    hey all
    i have an inputbox and when i try to put validation code on it
    i want the user to only return numbers and the numbers can only exist in range a of sheet 1

    so here is what i have mocked up quickly but obviously changed it around a bit.

    Please Login or Register  to view this content.
    ideally i want to keep it as simple as possible.
    my code through out the entire project is very shifty.. haha

    but this is the last thing i have left to do :D
    hopefully i can contribute more than break everyones !
    Last edited by royUK; 05-17-2010 at 01:18 AM. Reason: remove offensive language

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: inputbox validation

    Hi,

    Since you appear to want to limit the user's choice to values that already exist in column A and then presumably want to do something with that choice, don't bother with an Input Box, give the user a ListBox instead so that they can't do anything but select a valid choice

    If the unique values in column A are static, create a list of allowable values somewhere else and name this say, 'Input_Vals"
    Now use the .RowSource property of the Input Box and specify the name 'Input_Vals'. The user will only be able to select from the allowable values.

    If the unique values are changing over time, then just enhance your macro so that the first thing you do each time is use an Advanced Filter to extract a list of unique names from column A. So make sure you have a column label at the top of your column A data, put this same label in a cell named say 'Data_Out" and then

    Please Login or Register  to view this content.
    Assuming the DataOut range is in column Z, define the dynamic range Name 'Input_Vals' as

    Please Login or Register  to view this content.
    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: inputbox validation

    Please Login or Register  to view this content.
    But you could better test a users permission without bothering an enduser using:

    Please Login or Register  to view this content.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: inputbox validation

    Pavlos, this is a family Forum & I have received complaints about your language in this post. Any more use of bad language will result in a ban.
    Your thread is being closed for non compliance with our rules. Please PM me when you have read the forum rules RULES and can assure me you wil follow them in future, I will then unlock your post so you may continue with the thread!

    Post Closed
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

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