Hi all,
my problem is this:
1'st I'm an Excel noob, haven't really used any advanced features.
2'nd I need to copy specific information from a cell that has a lot of other text that's not needed in it.
3'rd This has to be done several thousand times.
f.ex. I've got a thousands of cells with: "Product name, compatability, product number, product dimensions, product specifications". How do I copy "compatability" on all these to a separate cell for each of the "compatability" automatically? I guess I'll have to use a macro, but does anybody know how I should code this?
Would greatly appreciate any help.
Best regards
Thomas.
Last edited by vikingim; 01-18-2012 at 01:54 AM.
Not necessarily. Please post a sample with some typical examples and indicate what you need to extract and what "rules", if any, apply.I guess I'll have to use a macro
Regards, TMS
Hi TMS,
thank you for your fast response.
Here's a typical example of the content in one cell: produkt 226390 Barracuda Karizzma - 7,5x17" 4x108 - ET25 (73,1) - Mattsortpol. med valgfri kantfarge
What I need to extract here is 4x108 and get it in a separate cell and automation of the whole process on all rows.
I hope I've explained it good enough. hehe.
Thomas.
So, not quite. How would someone, other than yourself, determine where the data you want to extract starts and ends? It doesn't really matter if the data is extracted with a formula or VBA ... it is still essential to know those details, that is, the "rules". I'm not familiar with the Norwegian language so the words don't tell me anything.and what "rules", if any, apply
Regards, TMS
Last edited by TMShucks; 01-12-2012 at 09:36 AM.
The only "rule" I can think of, is that I know the data to be extracted is in this case "4x108".
I'm probably as familiar with what excel can or can not do as you are with the Norwegian language, so please don't shoot me for being ignorant. lol.
Thomas.
I'm not shooting you for your ignorance of Excel. I'm just explaining that I, and others, need to go within the string to extract the data. You know why you're looking for 4x108. Why? Is there always a double quote and a space before it? Is there always a space hyphen space after it?
If it is, this works (at least, for this specific example):
=MID(A2,FIND(""" ",A2)+2,FIND(" - ",A2,FIND(""" ",A2))-FIND(""" ",A2)-1)
If you were to tell me to come visit you, but didn't tell me your address ... country, city, road, house number ... I wouldn't know how to get there. I need some guidance.
Regards, TMS
The reason I know I'm looking for 4x108 isn't in the string as far as I see it, other than that I know it's 4x108 I'm looking for.
Isn't it possible to do a search for 4x108 and copy it to the cell next to the row it's extracted from?
I'm sorry if my explanation and understanding of it is bad.
Thomas.
If your "compatibility string" was consistent in some manner, this would be easier. Perhaps you have a set list of all the possible compatibility strings, and its only 5-10 options? If so, you can list those in a column for reference to help. So over in column Z put your list:
4x108
5x109
4x200
2x75
Then for the string in A2, put this formula in B2:
=LOOKUP(2, 1/(--(ISNUMBER(SEARCH($Z$1:$Z$4, A2)))), $Z$1:$Z$4)
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
Hi JBeaucaire,
Your suggestion looks reasonable to me.
I've tried doing as you said, but I get an error when trying to save the formula in the cell.
The error is "error in the formula" or something similar to that.
I have a Norwegian version of Excel so I had to translate it. :P
I've also tried translating the formula to Norwegian, but there's still the same error.
Thanks for your help, I greatly appreciate it.
Thomas.
Last edited by vikingim; 01-16-2012 at 03:51 AM.
Here's a screenshot from one of the sheets I need it on, I hope it clarifies things a bit.
excel1.gif
Thanks,
Thomas.
Why screenshots? Click GO ADVANCED and use the paperclip icon to post up a copy of your workbook.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
Based on the picture, the formula to get the string from C2 would be:
=LOOKUP(2, 1/(--(ISNUMBER(SEARCH($H$2:$H$11, C2)))), $H$2:$H$11)
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
That's what I thought as well, but I've tried both Norwegian and english version of the commands, but still get the error message. I've double checked the norwegian equalents to the LOOKUP, ISNUMBER and SEARCH commands. I have no idea why it doesn't work. I guess it would have worked if I had the english version though. lol.
Here's the workbook.
eksperimentark1.xlsx
No, there's nothing country specific about that formula other than the commas vs semicolons.
I added a named range called CODES to this worksheet. (Ctrl-F3 to see it) This named range will expand itself as you add/delete items from the H column. Ths changed the formula to:
=LOOKUP(2, 1/(--(ISNUMBER(SEARCH(Codes, C2)))), Codes)
....which I put into E2, works fine.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks