Hello Forum,

I am super new to VBA, thus joining this forum for help, so please bear with me.

I have an excel file with table data (columns A to AE already have data) and I am trying to create a new column at the end of the table (column AF) based on data that exists in columns M and X.

I'm sorry, I would share the table, but it includes confidential information (I work in HR). The reason I need to do it in VBA is because this report will have to be populated monthly with the same criteria.

So for example, I need to insert a "YES" or "NO" in cell AF2 if cell M2 and X2 say certain text.

Can anyone please help me in writing this code?

My premature coding skills are ask follows:


If (Range("M").Text) = "Marketing" & (Range("X").Text) = "Amsterdam" or "The Hague" or "Deer Park" or "Sydney" or "Mumbai" or "Bhiwandi" or "Singapore" or "Silver Spring" Then
Range("AF").Text = "YES"
Else: Range("AF").Text = "NO"
End If

Thanks Forum!

HRA