+ Reply to Thread
Results 1 to 3 of 3

Data validation with formulas

Hybrid View

  1. #1
    Registered User
    Join Date
    11-10-2005
    Location
    Scotland
    Posts
    69

    Data validation with formulas

    Hi

    This one has me beat.

    I have attached an example excel sheet to clarify what I am looking for and I will list the procedures here:
    B11 is given a value from a drop down list
    C11 is also given a value from a data validation list either "YES" or "X"
    I would like to have an automatic process whereby
    If B11 value is set to "CASH" - C11 changes to (fill colour green) and "YES"
    I have managed to get it to change colour to green with a conditional format, but I can't change the C11 cell value to "YES"
    I would like it to work so that if you then change the value of B11 to something other than "CASH", you have the option to set a new value of either "YES" or "X" from the drop down list in C11.

    I would also like for C11 to be blank with no fill if B10 =0 - likewise i would like the formulas, drop down lists and formatting to work no matter when the values are changed or how many times they are changed.

    I suspect this cannot be done without using VBA (which I have never used), but any pearls would be much appreciated.

    This spreadsheet will be for personal use to track receipts and expenditure.

    Thank you in advance

    Craig
    Attached Files Attached Files

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Data validation with formulas - is this possible?

    You will have to use VBA to accomplish this.

    See if the attached is what you intended.

    Data validation was removed from C11 and an active-x combobox used in its place.

    Option Explicit
    
    Private Sub ComboBox1_Change()
    
        With Me
            Range("C11") = .ComboBox1.Value
            .ComboBox1.Visible = False
        End With
    
    End Sub
    
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
        If Not Intersect(Target, Range("C11")) Is Nothing Then
            Select Case Range("B11").Value
                Case Is = "CASH"
                    Range("C11").Value = "Yes"
                    Range("c11").Interior.ColorIndex = 5
                Case Else
                    Range("C11").Interior.ColorIndex = xlNone
                    Me.ComboBox1.Visible = True
            End Select
        End If
    
    End Sub
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    11-10-2005
    Location
    Scotland
    Posts
    69

    Re: Data validation with formulas

    Thanks for this Palmetto
    I didn't mean to double post - i didn't think this post worked. After i posted it i couldn't find it - even through search, so i figured it hadn't been properly submitted.
    I then re-wrote the question and re-posted.

    Thanks for taking the time to look at this for me.
    I will give your VBA a go and let you know how it goes.

    Cheers

    Craig

+ 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