Macro/Formula in Excel

Closed
Manisha - Jun 21, 2012 at 12:58 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jun 25, 2012 at 09:16 AM
Hello,

I want to search for a word in the format eg.ABC-2012-123( where only ABC is fixed and the other numbers after hyphen keeps changing) in each cell of the column and give the search string as the Word beginning with ABC so that it returns the complete word say ABC-2012-123 in the adjacent cell of the next column.

Thanks
Related:

3 responses

TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 552
Jun 21, 2012 at 10:08 AM
Hi Manisha,

So ABC is fixed and you want to search the column for ABC.
Then every cell with data will give a positive result.

I must be missing something.
0
Hi TrowaD

Yeah we need to search the string starting with ABC ( suppose the string is ABC-1922-2223) so it should return the string only in the format of ABC-1922-2223 and copy the complete string ABC-1922-2223 i.e in the adjacent cell of the next column. If there are more than one string of the type ABC-1922-2223 example ABC-20090-1236 in the same cell then it should also be copied to the same cell location.

For ex:- please find the excel sheet format with Data and ABC are the column headings. There are many such rows and we need to search in each cell of the DATA column and copy the result in the adjacent cell of the column named ABC. Suppose workbook name is XYZ.The columns are present in sheet2.

DATA ABC

jhsjshjs ABC-2992-2223 ghgghg ABC-8373-3636 dhdh ABC ABC-2992-2223
ABC-8373-3636


hgs ABC-2282-3337 hsgs ABC-2733-7377 dhd ABC-7366-3333 ABC-2282-3337
ABC-2733-7377
ABC-7366-3333

Please do let me know in case of any more query


Thanks,
Manisha


Please note that above format may not come as it is, DATA and ABC are two different columns. Under ABC only the string with the format ABC-2992-2223
ABC-8373-3636 will come.
0
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 552
Jun 25, 2012 at 09:16 AM
Hi Manisha,

So the format of sheet2 looks like:

Data         ABC
jhsjshjs     ABC-2992-2223
ghgghg	     ABC-8373-3636
dhdh	     ABC-2992-2223
	     ABC-8373-3636
hgs	     ABC-2282-3337
hsgs	     ABC-2733-7377
dhd	     ABC-7366-3333
	     ABC-2282-3337
	     ABC-2733-7377
	     ABC-7366-3333


And you want to search the ABC column to find a string starting with ABC?
Aren't they all starting with ABC?

What are you not telling me? :)

Best regards,
Trowa
0