PDA

View Full Version : Help with a simple Macro



antonyjones1
02-04-2012, 12:15 AM
Hi all,

I was wnodering if someone could help me with a simple macro I need to put together.

I need to put together a macro that will search the first worksheet in excel for all entries in column "Name" that don't contain the character *. If it comes across a row with no * in it I then want it to Search column "description" to ensure that this Name has "Jam" as well as "Toast". If only toast and no Jam is being received I want it to check if this name has "Butter". If the name is receiving butter I want it to populate a second worksheet with the "number","Name" and a "notes" column. The number field is the number from sheet 1 the name field is the name from sheet 1 and the entry in notes is "no jame but butter". If no butter or Jam is being received then I want it to pull the name,number and then in notes say "toast only". I also want it to check for multiple instances of jam. So If there are 3 rows with the same name having jam I want it to populate the new sheet with name,number and under notes say "3 lots of jam".

I have attached a spreadsheet with data in sheet 1 and the results i'm looking to achieve in sheet 2. Thanks in advance for all help!

Bob Phillips
02-04-2012, 03:51 AM
Is this for real?

What happens if the first entry has no Toast, but a subsequent one does?

antonyjones1
02-04-2012, 05:19 AM
Hi, there is a 'Toast' associated to every number. What I'd hope to do is getting the variable associated to 'Toast', say 'Jam', 'Butter' and the like.

antonyjones1
02-04-2012, 05:53 AM
Basically what I am looking to achieve is to search the worksheet ignoring names beginning with * in the name column. Then checking the other column for who is having just toast, toast and butter or toast and more than 1 jam with these results returned in a new worksheet.