Macro to find text in list and change value in adjacent cell

Daniel F

New Member
Joined
Feb 22, 2018
Messages
2
Hi!

I would like help to make a macro which will find specific suppliers, specified in advance (preferably listed in the macro itself) for example supplier "Alpha" and "Bravo", in column M of a list and for each row where the supplier is found, change the value in column O of that row to the text "Res". The list will have a different amount of rows each month.

The file where i will use this macro will have the same columns each month but will change name so i would have to use the macro from my personal.xlsb

Preferably i would post what code i have so far but its been so long since i last made a macro that i have not really gotten anywhere with it

I appreciate any help you can give

Please ask away if there is any more information i can supply you with. I have read the rules and searched the forum for applicable answers but im new to the forum so please advice if i have missed anything.

Best regards, Daniel
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Hi & welcome to the board.
How about
Code:
Sub AddRes()

   Dim Ary As Variant
   
   Ary = Array("[COLOR=#ff0000]Hertsmere[/COLOR]", "[COLOR=#ff0000]Stevenage[/COLOR]", "[COLOR=#ff0000]Meriden[/COLOR]")
   With ActiveSheet
      If .AutoFilterMode Then .AutoFilterMode = False
      .Range("M:M").AutoFilter 1, Ary, xlFilterValues
      .Range("O2", .Range("M" & .Rows.Count).End(xlUp).Offset(, 2)).SpecialCells(xlVisible).Value = "Res"
      .AutoFilterMode = False
   End With
End Sub
The sheet with the data will need to be the active sheet when you run it.
Change the values in red to match your suppliers
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,874
Members
452,363
Latest member
merico17

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