ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Bracket (https://www.excelbanter.com/excel-programming/413466-bracket.html)

Ranjit kurian

Bracket
 
i need a macro code to identify the words which are mentioned inside the
bracket.
The macro should create a variable for the words inside the bracket then
compare the variable which are in bracket and pull out the items related to
that particular.

example:

Question:
sheet one contain the below details
(TNT)Titan co
(ANPS)Assocation
(SSTS)Socity

Sheet two contain the below details
coln1. coln2.
(TNT) TT
(ANPS) AA
(SSTS) SS


Answer: my macro should do a kind of vlookup b/w sheetone and sheettwo and
it should through the answer as shown below


TT
AA
SS

Charlie

Bracket
 
You can use a "Helper" column on sheet one. Enter the formula

=LEFT(A1,FIND(")",A1))

and drag down the column. Use the helper column in your VLookup.

Regards,
Charlie

"Ranjit kurian" wrote:

i need a macro code to identify the words which are mentioned inside the
bracket.
The macro should create a variable for the words inside the bracket then
compare the variable which are in bracket and pull out the items related to
that particular.

example:

Question:
sheet one contain the below details
(TNT)Titan co
(ANPS)Assocation
(SSTS)Socity

Sheet two contain the below details
coln1. coln2.
(TNT) TT
(ANPS) AA
(SSTS) SS


Answer: my macro should do a kind of vlookup b/w sheetone and sheettwo and
it should through the answer as shown below


TT
AA
SS


Ranjit kurian

Bracket
 
hi Charlie

Thanks for the code it really helped me.

is there any way to remove the brackets example:

Question : (TNT)
Answer : TNT (remove the bracket, then give only the text)


"Charlie" wrote:

You can use a "Helper" column on sheet one. Enter the formula

=LEFT(A1,FIND(")",A1))

and drag down the column. Use the helper column in your VLookup.

Regards,
Charlie

"Ranjit kurian" wrote:

i need a macro code to identify the words which are mentioned inside the
bracket.
The macro should create a variable for the words inside the bracket then
compare the variable which are in bracket and pull out the items related to
that particular.

example:

Question:
sheet one contain the below details
(TNT)Titan co
(ANPS)Assocation
(SSTS)Socity

Sheet two contain the below details
coln1. coln2.
(TNT) TT
(ANPS) AA
(SSTS) SS


Answer: my macro should do a kind of vlookup b/w sheetone and sheettwo and
it should through the answer as shown below


TT
AA
SS


Charlie

Bracket
 
=MID(A1,2,FIND(")",A1)-2)

"Ranjit kurian" wrote:

hi Charlie

Thanks for the code it really helped me.

is there any way to remove the brackets example:

Question : (TNT)
Answer : TNT (remove the bracket, then give only the text)


"Charlie" wrote:

You can use a "Helper" column on sheet one. Enter the formula

=LEFT(A1,FIND(")",A1))

and drag down the column. Use the helper column in your VLookup.

Regards,
Charlie

"Ranjit kurian" wrote:

i need a macro code to identify the words which are mentioned inside the
bracket.
The macro should create a variable for the words inside the bracket then
compare the variable which are in bracket and pull out the items related to
that particular.

example:

Question:
sheet one contain the below details
(TNT)Titan co
(ANPS)Assocation
(SSTS)Socity

Sheet two contain the below details
coln1. coln2.
(TNT) TT
(ANPS) AA
(SSTS) SS


Answer: my macro should do a kind of vlookup b/w sheetone and sheettwo and
it should through the answer as shown below


TT
AA
SS



All times are GMT +1. The time now is 01:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com