VBA Identify, Copy,Paste

Eraengineer

Board Regular
Joined
Jun 12, 2011
Messages
226
I am looking for a solution to this issue and it needs to be solved in visual basic. I need a search of column C. The cells in column C will contain:
C1:lzs,prb,mac
C2:lzs,mac
C3:pls,mac



if the a cell contains lzs then that cell needs to be copied along with cell B and Cell A by using maybe the offset? Once those cells are copied they need to be pasted to the lzs sheet. If the cell contains prb then the info also needs to be copied to the prb sheet and the same for mac.

This search needs to happen until the next cell in column C is blank and then end the loop.

Please help!
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
The cells in column C will contain:
C1:lzs,prb,mac
C2:lzs,mac
C3:pls,mac


if the a cell contains lzs then that cell needs to be copied along with cell B and Cell A by using maybe the offset?

"....cell B and Cell A" - There is no such thing Eraengineer.

You'll need to be more specific. e.g. A1, B7, etc.



If the cell contains prb then the info also needs to be copied to the prb sheet....

"the info...." The "info" in what cell?

In your first example, C1 contains "lzs,prb,mac" then cell A1 & B1 need to be copied to all 3 sheets? Or just one of them? Likewise what if a cell contains only 1 term such as "mac". Do you still need the corresponding A & B cells in that row to be copied?

Your post is clear as mud to me - just what do you need copied?



I am looking for a solution to this issue and it needs to be solved in visual basic.

This is a VBA forum. Although they are similar, it is not quite correct to say "visual basic".
 
Upvote 0
To be clearer:
This will be just an example...

This is what the cells contain on the planning sheet
A1:x B1:y C1:a,b,c
A2:y B2:z C2:b,a
A3:z B3:y C3:a,b


I need the a,b,c information in cell C1 to be placed in sheeta, sheetb, and sheetc since that cell contains a,b,c. Now with that said there is also information in Cell A1 and cell B1 and that information needs to be copied and pasted to the sheets as well. All this information can be plasted in the same place in those sheets.

After Row 1 is done then the search must move on to row2 then 3 etc. until it reaches a row with no information in column C.

Is this clearer?
 
Upvote 0

Forum statistics

Threads
1,224,594
Messages
6,179,795
Members
452,943
Latest member
Newbie4296

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