Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a spreadsheet where columns BE and BF look something like this:
BE BF 1 Country Continent 2 From France 3 England 4 In China 5 To Brazil and others etc. Cells in column BE will only have one of 47 countries, but the country name is not necessarily the first thing in the cell. It can be in the middle or the end as well. I want to write a VBA code that goes through column BE cell by cell, checks if it 'contains' one of the 47 countries, then in the adjacent cell in column BE puts the name of the continent where this country is located. I tried to use an IF Statement (as shown below) but i got stuck on how to use the wildcard as well as the 'OR': Dim Y as long For Y = 10 to 300 If cells(Y, 57).value = OR(*France*,*Italy*,*England*) then cells(Y, 58).value = "Europe" Else If cells(Y, 57).value = OR(*China*,*Japan*,*singapore*) then cells(Y, 58).value = "Asia" Else etc ... I'm still fairly new with VBA and need some guidance please. I'm using Excel 2003. Many thanks Tendresse |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using the wildcard with IF | New Users to Excel | |||
wildcard | Excel Programming | |||
Wildcard | Excel Programming | |||
Wildcard | Excel Programming | |||
Wildcard | Excel Programming |