Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
writing macro to match the group and age
i am trying to write a macro to match age &group
for example I am 19 and I am in the group 1 so I am trying to write the macro to give the answer of which group I belong to group 1:0-20 ages group 2 :21-30 ages group 3:31-40 ages group 4: 41-50 ages thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
writing macro to match the group and age
On Sep 21, 5:07*pm, ipek wrote:
i am trying to write a macro to match age &group for example I am 19 and I am in the group 1 so I am trying to write the macro to give the answer of which group I belong to group 1:0-20 ages group 2 :21-30 ages group 3:31-40 ages group 4: 41-50 ages thanks Option Explicit Sub whichagegroup() Dim x As Integer Select Case ActiveCell Case 0 To 20: x = 1 Case 21 To 30: x = 2 Case 31 To 40: x = 3 Case 41 To 50: x = 4 Case Else MsgBox "What about us old folks?" Exit Sub End Select MsgBox x End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Match a group of cells with another group of cells | Excel Worksheet Functions | |||
Help with writing macro | Excel Programming | |||
writing a macro for search-match-copy | Excel Programming | |||
Writing an If Statement for group of cells | Excel Programming | |||
Macro Writing | Excel Programming |