Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Creating a ratings list in Excel


I'm trying to create a list where users could rate their preferences on
a 1-10 scale.
For example, column A might contain apples, pears, oranges, bananas.etc.
In column B, user would assign preference on a numerical scale. Column
B should not contain duplicate values, i.e. there should be only a
single "1" or "2". Perhaps a message box to flag duplicates?


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Creating a ratings list in Excel

Dennis,

This assumes your ratings are in the range B1:B10 - change as necessary. If
somebody enters a duplicate value in that range it erases the previous
occurence of the value. It checks for entering into more than one cell at a
time.

Paste this code into the code module for the worksheet - right-click the
sheet tab and choose View Code:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim target_cell As Range, cell As Range, ratings As Range

Set ratings = Range("B1:B10")
On Error GoTo err_handler
Application.EnableEvents = False
If Not Intersect(Target, ratings) Is Nothing Then
For Each target_cell In Target
For Each cell In ratings
If cell.Address < target_cell.Address And _
cell.Value = target_cell.Value And _
Not Intersect(target_cell, ratings) Is Nothing Then
cell.ClearContents
End If
Next cell
Next target_cell
End If

err_handler:
Application.EnableEvents = True

End Sub

hth,

Doug Glancy

"Dennis Gaucher" wrote in message
...

I'm trying to create a list where users could rate their preferences on
a 1-10 scale.
For example, column A might contain apples, pears, oranges, bananas.etc.
In column B, user would assign preference on a numerical scale. Column
B should not contain duplicate values, i.e. there should be only a
single "1" or "2". Perhaps a message box to flag duplicates?


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate % from list of scores or ratings P. Hayes Excel Worksheet Functions 3 March 5th 10 09:31 PM
ratings Allllen Excel Discussion (Misc queries) 2 January 31st 07 09:34 PM
Ratings Dave Excel Discussion (Misc queries) 2 December 11th 06 07:45 PM
Horse Ratings Saxman Excel Discussion (Misc queries) 4 August 16th 05 10:27 PM
Creating list in Excel shethn Excel Worksheet Functions 1 March 6th 05 02:51 PM


All times are GMT +1. The time now is 06:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"