Link to home
Create AccountLog in
Avatar of Dier02
Dier02Flag for Australia

asked on

how to get data validated lists in excel to score

I want to be able to use a drop down that I create in Excel using data validation (list) to assign a score to the cell next to the drop down in VBS.  How would I do that.  See file attached.
QCATScience.xls
Avatar of dlmille
dlmille
Flag of United States of America image

For example, put scores in H13:H23?  You can do that with VBA, but why not a formula?

How would you like to score?  Give an example of a drop down selection and relative score?  Do you have a table of scores based on drop-down values?  That would need to be provided in the spreadsheet, somewhere...

Dave
Avatar of Dier02

ASKER

I suppose you could do a drop down for the score but I was thinking it would be easier if you dropped down for the descrip[tor - which is already in the file - and VBA scored according to that descriptor.
Avatar of Dier02

ASKER

When you get to the end of the file- after filing in all the drop downs the idea is that the aggregated score is turned into an A,B,C,D or E.  Thats the end view.  At this point I just wanted to have only one drop down to get the score and the scoring would be 1 to 10.
Ok.  Let's back up a bit.  The user selects a dropdown value from the list.  As a result of that dropdown, a score is tallied, somewhere.  And then, for the entire sheet, there's a score made up of all the scores in the sheet, correct?
Avatar of Dier02

ASKER

Yes, and then the final score is converted to an A,B,C,D or E.
GREAT.  You need to provide more information, however.  Please pull up the worksheet you posted, and make sample entries, then beside the sample entries, notate how that entry would have been scored.  I cannot help you without understanding how you would score each and every response possible.  Feel free to create a table of responses and their respective scores on another tab with your example.  From that, it should move quickly.

Cheers,

Dave
Maybe I'm not being clear enough.  Does every dropdown in the sheet result in a score, or is it just those at the bottom of the sheet?

Regardless, you need to identify which need a score and what the score would be for each possible response in the dropdown.  You can do that by creating a table of the possible responses (re: dropdowns) and score right beside it.  From that, a score could automatically be tallied, etc...

Dave
Avatar of Dier02

ASKER

Will do and sesend, thanks Dave.
Avatar of Dier02

ASKER

Just sent some code that is sort of along that road.  Will score sheet and resend.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myRange As Range, TestRange As Range
Set myRange = Range("H13:H23")
Set TestRange = Intersect(Target, myRange)
If TestRange Is Nothing Or Target.Cells.Count > 1 Then Exit Sub
    Select Case Target.Value
        Case "how hard I blow"
            Target.Offset(0, 1).Value = 5
            
            
        Case "Bob"
            Target.Offset(0, 1).Value = 2
            
            
        Case "Dave"
            Target.Offset(0, 1).Value = 3
           
            
            Case 4
            Target.Offset(0, 1).Value = 4
            
            
            
        Case 5
            Target.Offset(0, 1).Value = 5
            
            
        Case 6
            Target.Offset(0, 1).Value = 6
            
            
            Case 7
            Target.Offset(0, 1).Value = 7
            
            
            
        Case 8
            Target.Offset(0, 1).Value = 8
           
            
        Case 9
            Target.Offset(0, 1).Value = 9
            
            
            Case 10
            Target.Offset(0, 1).Value = 10
            
            
            
        
            
    End Select
End Sub

Open in new window

Avatar of Dier02

ASKER

Here is the scored file - the hyperlink to scores shows the scoring for each.
QCATScience.xls
Avatar of Dier02

ASKER

Dave?
Avatar of Dier02

ASKER

How is it going?
Sorry, I've been out a couple days.  This was a good start, but incomplete as to table of responses and score.  I could perhaps provide a sample solution, moving downward a bit on the questionnaire, to demonstrate what I'm talking about.  But, to do the entire questionnaire is a big job, from what's been provided so far.

I'll start working on it and give you a partial to demonstrate how to do this, and submit something this weekend.  Will that work for you?

Dave
ASKER CERTIFIED SOLUTION
Avatar of dlmille
dlmille
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
just post back here if you have any issues.

Dave