Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Reversing scores in a questionnaire

In school i have used a questionnaire with 29 questions. Every question is
given a score from 1-7. I need to reverse the scores of a couple of
questions. Meaning that 1 becomes 7, 2 becomes 6, 3 becomes 5, 4 is still 4,
and vice versa. How do i go about doing this? I need a program that
automatically changes the number when i enter it. Thanks
/Harald
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Reversing scores in a questionnaire

Private Sub Worksheet_Change(ByVal Target As Range)
application.enableevents = false
select case target.value
case 1
target.value = 7
case 2
target.value = 6
case 3
target.value = 5
case 5
target.value = 3
case 6
target.value = 2
case 7
target.value = 1
end select
application.enableevents = true
end sub

HTH

"Harald Lund" wrote:

In school i have used a questionnaire with 29 questions. Every question is
given a score from 1-7. I need to reverse the scores of a couple of
questions. Meaning that 1 becomes 7, 2 becomes 6, 3 becomes 5, 4 is still 4,
and vice versa. How do i go about doing this? I need a program that
automatically changes the number when i enter it. Thanks
/Harald

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Reversing scores in a questionnaire

Do you really need to have a program to do this or will a worksheet
formula work? If not, how do you enter the data? through a text box on
a form or directly into the worksheet?
it is pretty simple to reverse the sco 8 - score
8 - 3 = 5
8 - 1 = 7
8 - 7 = 1
Worksheet formula where A1 = the score 3:
B1 formula "=8 - A1"

Let me know exactly what you are doing and more detail about what you
need if this didn't get you pointed in the right direction.
Regards--Lonnie M.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Reversing scores in a questionnaire

Harald,

Here is one way. Change the range to suit

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:H10")) Is Nothing Then
With Target
If IsNumeric(.Value) Then
If .Value 0 And .Value < 8 Then
.Value = 8 - .Value
End If
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Harald Lund" <Harald wrote in message
...
In school i have used a questionnaire with 29 questions. Every question is
given a score from 1-7. I need to reverse the scores of a couple of
questions. Meaning that 1 becomes 7, 2 becomes 6, 3 becomes 5, 4 is still

4,
and vice versa. How do i go about doing this? I need a program that
automatically changes the number when i enter it. Thanks
/Harald



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Reversing scores in a questionnaire

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Target.Value = 8 - Target.value
Application.EnableEvents = True
End Sub


"Harald Lund" <Harald wrote in message
...
In school i have used a questionnaire with 29 questions. Every question is
given a score from 1-7. I need to reverse the scores of a couple of
questions. Meaning that 1 becomes 7, 2 becomes 6, 3 becomes 5, 4 is still
4,
and vice versa. How do i go about doing this? I need a program that
automatically changes the number when i enter it. Thanks
/Harald



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
Questionnaire pkuphenix Excel Worksheet Functions 0 March 10th 09 08:44 AM
Questionnaire pkuphenix Excel Worksheet Functions 0 February 22nd 09 11:39 AM
Questionnaire pkuphenix Excel Discussion (Misc queries) 0 February 22nd 09 11:32 AM
excel golf scores, how do I add the scores for all par 3's etc Golf Analyst Excel Worksheet Functions 2 November 24th 07 02:25 PM
Questionnaire ? Allen Robinson Excel Programming 1 May 28th 04 05:40 PM


All times are GMT +1. The time now is 11:13 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"