--------------------------------------------------------------------------------
I have a range of cells that contains data in the form on strings. I need to extract a part of this string and paste it (to the empty cell on the right).
Range "AV" contains the cells with strings
I need to extract the data between "0" OR "0:" and till the end of the string in the cell OR till "1"
Can anyone show me how to do this with a Macro (VBA code) or anyway else ? Thank You
example :
(String in a cell)
shawn012k
0: james
pdf: 321
1:
pdf:
2:
pdf:
Extracted Data (pasted in the cell to the right):
james
pdf: 321
Last edited by jimmy_nora; 10-27-2010 at 07:17 AM.
jimmy_nora, welcome to the board.
I am sure you will have the Forum Rules and as such will be aware that if you choose to post the same question in more than one online Forum we ask you disclose all relevant links.
http://www.mrexcel.com/forum/showthread.php?t=502979
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Incidentally why do you need VBA to do this - would a formula not suffice ?
B1: =TRIM(REPLACE(LEFT(A1;FIND(CHAR(10)&"1:";A1&CHAR(10)&"1:")-1);1;FIND("0:";A1&"0:")+1;"")) wrap text activated
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
what do you mean by "disclose all relevant links" ?
code does not work !
You should tell us that you have posted in other forums and provide the link so people do not waste their time answering questions which have already been solved elsewhere.
Is there anyway I can further manipulate this formula to trim only the part between "1" or "1:" and "2:" or "end of cell" ?
In this case I need to ignore the first 1: because it occurs before the 0:
example:
user bio1:
0: asdasdas
1: asdasds
2:
3: asdas
required data:
asdasds
jimmy_nora please at least detail the fact that you have updated your thread at MrExcel with the same - granted it remains the same cross post (detailed by me) but it's not clear from your post you have done this.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
hi i think this will be helpful.
=LEFT(RIGHT(B4,LEN(B4)-FIND("1",B4)),FIND("0",RIGHT(B4,LEN(B4)-FIND("1",B4)))-1)
this formula gives you the string between 0 and 1.
you can change the character in place of 0 or 1.
Last edited by DonkeyOte; 10-22-2010 at 05:14 AM.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
=LEFT(RIGHT(B4,LEN(B4)-FIND("1",B4)),FIND("0",RIGHT(B4,LEN(B4)-FIND("1",B4)))-1)
Paste this formula in cell C4.
and Enter the string into B4.
It will work definetly
@jimmy_nora
I have posted an update to your thread at MrExcel.com with screenshot of output
http://www.mrexcel.com/forum/showthread.php?t=502979
I have added a file here.
Last edited by DonkeyOte; 10-22-2010 at 05:32 AM.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks