Range of numbers equals 1 number
Closed
John906
-
Nov 18, 2010 at 09:47 AM
TrowaD
TrowaD
- Posts
- 2886
- Registration date
- Sunday September 12, 2010
- Status
- Moderator
- Last seen
- June 27, 2022
Related:
- Range of numbers equals 1 number
- Add range if number is 1 to 10, 11-21,22-30 ...and so ✓ - Forum - Office Software
- Excel formula if cell contains text then equals 1 ✓ - Forum - Excel
- 1 percentage is equal to how many paise - Forum - Office Software
- Range(selection selection.end(xldown)).select - 1 - Forum - Office Software
- 192 l.168.0.1 - Guide
1 reply
TrowaD
Nov 18, 2010 at 10:36 AM
- Posts
- 2886
- Registration date
- Sunday September 12, 2010
- Status
- Moderator
- Last seen
- June 27, 2022
Nov 18, 2010 at 10:36 AM
Hi John906,
Try this code:
First copy the code.
Then goto excel and right click on the sheets tab and click on 'view code'.
Paste the code in the big white field.
Now you're done.
Please note: you haven't given the rest of the statements. You will have to change them first before the code will work properly.
Let me know if you get stuck somewhere.
Best regards,
Trowa
Try this code:
Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub If Range("A1") >= 1 And Range("A1") <= 10 Then Range("B1") = "45%" If Range("A1") >= 11 And Range("A1") <= 20 Then Range("B1") = "32%" If Range("A1") >= 1 And Range("A1") <= 10 Then Range("B1") = "45%" If Range("A1") >= 1 And Range("A1") <= 10 Then Range("B1") = "45%" If Range("A1") >= 1 And Range("A1") <= 10 Then Range("B1") = "45%" If Range("A1") >= 1 And Range("A1") <= 10 Then Range("B1") = "45%" If Range("A1") >= 1 And Range("A1") <= 10 Then Range("B1") = "45%" If Range("A1") >= 1 And Range("A1") <= 10 Then Range("B1") = "45%" If Range("A1") >= 1 And Range("A1") <= 10 Then Range("B1") = "45%" If Range("A1") >= 1 And Range("A1") <= 10 Then Range("B1") = "45%" If Range("A1") >= 1 And Range("A1") <= 10 Then Range("B1") = "45%" If Range("A1") >= 1 And Range("A1") <= 10 Then Range("B1") = "45%" If Range("A1") >= 1 And Range("A1") <= 10 Then Range("B1") = "45%" If Range("A1") >= 1 And Range("A1") <= 10 Then Range("B1") = "45%" If Range("A1") >= 1 And Range("A1") <= 10 Then Range("B1") = "45%" Else Range("B1").ClearContents End Sub
First copy the code.
Then goto excel and right click on the sheets tab and click on 'view code'.
Paste the code in the big white field.
Now you're done.
Please note: you haven't given the rest of the statements. You will have to change them first before the code will work properly.
Let me know if you get stuck somewhere.
Best regards,
Trowa