Excel / VBA - A macro to check the value of a column

Ask a question



Issue


I am trying to use VBA to check whether an M appears in column B and then, if it does, paste the information from that row (Columns A through to W) into another existing sheet in the workbook. I want this to be able to check the whole worksheet and then finish when it gets the end of the information in column B. Any ideas, I have been playing around with it for about 4 hours and have got nowhere!!!

Solution

  • use "=" or instr (depending if it is a exact match or contains match) to check for M
  • If found copy the row and paste to other sheet
  • move to next row
  • rinse and repeat

Note


Solved by rizvisa1
Jean-François Pillou

CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jeff Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.

Learn more about the CCM team