Hi,
I am new to vba and am stuck on how I get the below split into three columns?
A1=102341,80USD0,00
A2= 102341.80 (will also change the comma to a decimal afterwards)
A3=USD
A4=0,00 (will be deleted afterwards)
Thanks
Hi,
I am new to vba and am stuck on how I get the below split into three columns?
A1=102341,80USD0,00
A2= 102341.80 (will also change the comma to a decimal afterwards)
A3=USD
A4=0,00 (will be deleted afterwards)
Thanks
Do you need VBA ?
above assumes![]()
Please Login or Register to view this content.
all can be adapted as necessary.a) no leading zeroes in first number
b) first number always has 2 decimals (denoted by comma delimiter)
c) first number is followed by 3 letter currency code
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Yes, I do need VBA. I was able to get it to work in a normal excel sheet, but not in visual basic. There are actually multiple lines of data which require the same formatting and is currently in column K of my worksheet.
Here is a sample of additional lines:
102341,80USD0,00
31686,37USD0,00
42541,81USD0,00
89334,48USD0,00
92535,84USD0,00
The script I was attempting to use was:
What I need is for the currency "USD" to go into column I and the number (ex.102,341.80) to remain in column K.![]()
Please Login or Register to view this content.
Last edited by DonkeyOte; 01-20-2011 at 04:59 PM.
Per Forum Rules - please always use CODE tags when posting VBA.
Numerous approaches - no doubt plenty more efficient than the below but I'm rushing off I'm afraid so not much thought has gone into the below I'm afraid
change Sheet reference as per your requirements![]()
Please Login or Register to view this content.
Is the trailing value always 0,00 ? (and/or always has 2 decimals)
Try:
![]()
Please Login or Register to view this content.
Hello Viewson,
Here is another method to accomplish the task using Regular Expressions.
![]()
Please Login or Register to view this content.
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Starbelow the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
Yes, the trailing value is alway 0,00.
Thanks, the new code did work.
Hi Donkey,
Ran into a small issue today, when using the code below for only one line item on my spreadsheet I get a runtime error 13, type mismatch. Is there a way to use it when there is only one line item and then multiple lines.
Today's online line:
165751,39USD0,00
Pervious Multiple lines:
102341,80USD0,00
31686,37USD0,00
42541,81USD0,00
89334,48USD0,00
92535,84USD0,00
583075,02USD0,00
91665,89USD0,00
109809,74USD0,00
459433,87USD0,00
83198,76USD0,00
386154,16GBP0,00
![]()
Please Login or Register to view this content.
Aplogies for belated response - I have not been online.
You could try modifying vStr line to:
![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks