+ Reply to Thread
Results 1 to 8 of 8

Data Validation or conditional formating

  1. #1
    Registered User
    Join Date
    04-23-2007
    Posts
    54

    Data Validation or conditional formating

    Hello.I have a spreadsheet that I enter numbers in cells N 13 to N54 What im trying to do is put data validation in that column that will only allow user to enter the number 1 and nothing greater if the adjacent cell L 13 to L54 contains the word day. I would like it to either not let them enter number or give them a warning message..Any help would be appreciated.
    Thanks in advance

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,370

    Re: Data Validation or conditional formating

    Hi benswelding,

    If you want to show a message and test what is being entered I believe you need some Event VBA. Code like the following will get you started.

    Please Login or Register  to view this content.
    See the attached to give it a try. Type something in the yellow area and the worksheet event macro will fire. You will need to be more specific on what is allowed for us to do much more.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    04-23-2007
    Posts
    54

    Re: Data Validation or conditional formating

    Thanks for your help and sorry I didn't explain better.I dont want user to be able to input anything but a 1 in cells n13 to n54 if cells l13 to l54 contains the text day.Thanks for your help.
    Attached Files Attached Files

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

    Re: Data Validation or conditional formating

    Datavalidation in N13

    PHP Code: 
    =OR(L13&N13="day1";L13<>"day"



  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,370

    Re: Data Validation or conditional formating

    Ok - try this attached with the code of
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    04-23-2007
    Posts
    54

    Re: Data Validation or conditional formating

    Thanks for your help and I can see how my wording confused you (eg ) if L13 contains the text day then n13 can only contain the value 1 if L13 doesn't contain day then the value in cell n13 can contain any value,and I want this to happen through cells n13 to n54 and L13 to L54.Sorry again for not explaining this very well.Thanks for your help

  7. #7
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,370

    Re: Data Validation or conditional formating

    Hi,
    The last attached file should work as you want. It is always easier to understand the problem with a sample file.

    If the problem is solved you can edit the origional (first) thread and prefix it with [Solved]. That helps us not try to solve already solved questions.

    I hope you got the answer you needed.

  8. #8
    Registered User
    Join Date
    04-23-2007
    Posts
    54

    Re: Data Validation or conditional formating

    The problem with your sample sheet is if the text day is in any cell in column L..I can only enter a 1 in the cells in column n.I would only want the macro to change the adjacent cell.(eg)
    if L13 = Day then n13 would have to be a 1.If l13 did not have the text day n 13 could have any value.Thanks in advance

+ 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