First off all, hello everyone! Secondly I'm new to formula and macro so please don't shoot the messenger.
I'm trying to build a calendar which keep track of my physical fitness activities.
In column A I have, Activity(s) (A9), Distance (A10), and Points (A11).
When I type in the word "run" in cell H9 for example, I have the Distance Cell (H10)'s value multiple by 1 which gets inserted in the Points Cell (A11), if I have the word "row" typed in, it multiples the Distance Cell (H10) value by 2 and so on... as such:
Now that works fine for H9, H10 and H11. How to make the formula work for all the other day (G,H,I...) within the calendar without typing the code for every single day?
If I could also get the 'explanation that would be much appreciated.
That is the first question! One more to come shortly.
Thank you.
I'm trying to build a calendar which keep track of my physical fitness activities.
In column A I have, Activity(s) (A9), Distance (A10), and Points (A11).
When I type in the word "run" in cell H9 for example, I have the Distance Cell (H10)'s value multiple by 1 which gets inserted in the Points Cell (A11), if I have the word "row" typed in, it multiples the Distance Cell (H10) value by 2 and so on... as such:
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("h9").Value = "run" Then
Range("h11") = Range("h10") * 1
ElseIf Range("h9").Value = "row" Then
Range("h11") = Range("h10") * 2
ElseIf Range("h9").Value = "hockey" Then
Range("h11") = Range("h10") * 2
End If
End Sub
Now that works fine for H9, H10 and H11. How to make the formula work for all the other day (G,H,I...) within the calendar without typing the code for every single day?
If I could also get the 'explanation that would be much appreciated.
That is the first question! One more to come shortly.
Thank you.