If value is then copy

C

Carolina Girl

Can someone can help me??? I need a VBA code that will say…
if value of cell A2 is equal to “x†then copy G2:p2 to worksheet “test2â€
if value of cell B2 is equal to “x†then copy G2:p2 to worksheet “test3â€
etc...
if value of cell A3 is equal to “x†then copy G3:p3 to worksheet “test2â€
if value of cell B3 is equal to “x†then copy G3:p3to worksheet “test3â€
etc...
There has to be a faster way??? I have 6 items to check across and 350
down (more will be added. Please note row 2 may have an x in A2 and B2 but
row 3 may only have an x in B3..... Thank you in advance
 
D

Don Guillett

Have a look in the vba help index for select case and incorporate into a
for/each loop.
You don't say where in test2 to copy to
 
C

Carolina Girl

no have not looked but will... As for where in worksheet "test2" all 6
worksheets are set up with the same header row so it should past in the first
empty row starting on A2.
Thanks in advance....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top