Select Case Code Needed

HYKE

Active Member
Joined
Jan 31, 2010
Messages
373
Hello,

I have the following list of countries now I want to group according to region, then cluster classification and according to salesman. I am thinking of using select case but I do not know if 3 criteria is possible.

As below is the structure

Countries: ( Column A )

Bahrain
Iraq
Jordan
Kuwait
Lebanon
Oman
Palest. Terr.
Qatar
Saudi Arabia
U.A.E.
Yemen

Region ( Column B )
Gulf

Cluster : ( Column C )
Indirect


Salesman: ( Column D )
Salesman1

Countries: Column A
Benin
Cameroon
Centr.Afr.Rep.
Chad
Congo
Dem. Rep. Congo
Djibouti
Equatorial Gui.
Frenc.Polynesia
Gabon
Guadeloupe
Guinea
Guyana
Ivory Coast
Mauritania
Morocco
Niger
Tunisia

Region ( Column B )
French Africa

Cluster : ( Column C )
Direct


Salesman: ( Column D )
Salesman2

I hope you guys can come up with a really nice macro code for me as you all always have...

Thanks!

HYKE
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
I don't quite get what you're after but the multiple criteria is certainly possible.

Code:
For Each MyCell In Rng
With MyCell
Select Case True
Case .Value = "Hallo" And .Offset(0, -1).Text = "10""" And .Offset(0, -2).Text = "15""" And .Offset(0, -3).Text = "20"""
    'Do what needs to be done here
Case .Value = "Hallo" And .Offset(0, -1).Text = "10""" And .Offset(0, -2).Text = "15""" And .Offset(0, -3).Text = "30"""
    'Do what needs to be done here
etc etc
End Select
End With
Next MyCell
 
Upvote 0

Forum statistics

Threads
1,202,977
Messages
6,052,890
Members
444,608
Latest member
Krunal_Shah

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