Macro/Formula in Excel

[Closed]
Report
-
Posts
2818
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
October 18, 2021
-
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

3 replies

Posts
2818
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
October 18, 2021
486
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.
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.
Posts
2818
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
October 18, 2021
486
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