Macros Help

Beachcomber1224

New Member
Joined
May 12, 2011
Messages
18
I am in the process of creating a macro and am stuck. I would greatly appreciate anyone's help. I basically want to enter in data in the first part of an excel (there are 2 parts: 1 "regular" scoring, 1 "reversed" scoring) that will then convert these raw scored into my "converted" scores. These converted scores will go underneath where I enter the raw scores.

Here's my script that converts the "regular" score to the "converted" score:
1 (C3) à 0 (C44)<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
2 (C3) à 1 (C44)<o:p></o:p>
3 (C3) à 2 (C44)<o:p></o:p>
4 (C3) à 3 (C44)<o:p></o:p>
Using this code:<o:p></o:p>
Private Sub Worksheet_SelectionChange(ByVal Target As Range)<o:p></o:p>
Select Case Sheet1.Range("C3").Value<o:p></o:p>
Case 1 To 4<o:p></o:p>
Sheet1.Range("C44").Value = Sheet1.Range("C3").Value - 1<o:p></o:p>
Case Else<o:p></o:p>
Sheet1.Range("C44").ClearContents<o:p></o:p>
End Select
End Sub
<o:p></o:p>
Question 1
Can someone please help me come up with a script for converting the "reverse" scores from the following?
1 (C4) à 3 (C45)<o:p></o:p>
2 (C4) à 2 (C45)<o:p></o:p>
3 (C4) à 1 (C45)<o:p></o:p>
4 (C4) à 0 (C45)<o:p></o:p>
<o:p></o:p>
Question 2
I am writing this code for column C, is there a way I could loop this for all columns in the spreadsheet?

Thanks!
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Give this a go:

Sheet1.Range("C45").Value = Abs(Sheet1.Range("C4").Value - 4)
 
Upvote 0
That works! Thank you very much.

Do yuo have any thoughts on how I can loop this? My hope is to have this code run for each column as long as there is data in it.
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,850
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top