Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 8
Question converting number to dollar

I know this should be easy but it isn't.

I copy html spreadsheets off a web link in an email that has columns of data. One of the fields has dollar amounts like 1,565.00 that are formatted as general. I need to convert this to a dollar amount like $1,565. When I try to format the field to currency, nothing happens. I tried copying and pasting values in all the different formats. I made sure the column isn't locked. I have 3,500 rows of different amounts that I don't want to manually change.


Please tell me what I'm missing.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,514
Default converting number to dollar

I know this should be easy but it isn't.

I copy html spreadsheets off a web link in an email that has columns
of data. One of the fields has dollar amounts like 1,565.00 that are
formatted as general. I need to convert this to a dollar amount like
$1,565. When I try to format the field to currency, nothing happens.
I tried copying and pasting values in all the different formats. I
made sure the column isn't locked. I have 3,500 rows of different
amounts that I don't want to manually change.


Please tell me what I'm missing.


Assuming you did Copy/Paste instead of Copy/Paste SpecialUnicode Text,
the column with the dollar amounts was (by default) converted to text
during Paste. Select a cell in the dollar amount col and look in the
formula bar for a leading apostrophe...

'1,565.00

...whereby you need to use Copy/Paste SpecialUnicode to get Excel to
use your format. I use this method when pulling data in from Word
tables and it imports correctly.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #3   Report Post  
Junior Member
 
Posts: 8
Default

Quote:
Originally Posted by GS[_2_] View Post
I know this should be easy but it isn't.

I copy html spreadsheets off a web link in an email that has columns
of data. One of the fields has dollar amounts like 1,565.00 that are
formatted as general. I need to convert this to a dollar amount like
$1,565. When I try to format the field to currency, nothing happens.
I tried copying and pasting values in all the different formats. I
made sure the column isn't locked. I have 3,500 rows of different
amounts that I don't want to manually change.


Please tell me what I'm missing.


Assuming you did Copy/Paste instead of Copy/Paste SpecialUnicode Text,
the column with the dollar amounts was (by default) converted to text
during Paste. Select a cell in the dollar amount col and look in the
formula bar for a leading apostrophe...

'1,565.00

...whereby you need to use Copy/Paste SpecialUnicode to get Excel to
use your format. I use this method when pulling data in from Word
tables and it imports correctly.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
Thank you for the suggestion. But that didn't work.

The field looks like this "Total Bail Amount: 20,000.00". Yes these are arrest reports.

I run a custom macro to format the 27 columns of information into something workable. In the macro I remove the alpha characters from this column. With or without the alpha characters, I don't see any leading apostrophe.
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default converting number to dollar

Hi,

Am Mon, 16 Sep 2013 06:30:00 +0100 schrieb mytyab:

I copy html spreadsheets off a web link in an email that has columns of
data. One of the fields has dollar amounts like 1,565.00 that are
formatted as general. I need to convert this to a dollar amount like
$1,565. When I try to format the field to currency, nothing happens. I
tried copying and pasting values in all the different formats. I made
sure the column isn't locked. I have 3,500 rows of different amounts
that I don't want to manually change.


click on the column header to select the column and format the column
with your wished format and choose Data = TextToColumns = Fixed width
= Finish


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,514
Default converting number to dollar

Ah.., so the dollar amount are the result of parsing the original field
value. In this case Claus' suggestion is the way to go because it will
work with resulting data from Copy/Paste as well.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion




  #6   Report Post  
Junior Member
 
Posts: 8
Default

Very good suggestion but unfortunately it didn't work either.

Quote:
Originally Posted by GS[_2_] View Post
Ah.., so the dollar amount are the result of parsing the original field
value. In this case Claus' suggestion is the way to go because it will
work with resulting data from Copy/Paste as well.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default converting number to dollar

Hi,

Am Mon, 16 Sep 2013 20:12:13 +0100 schrieb mytyab:

Very good suggestion but unfortunately it didn't work either.


can you upload your file and post us the link?


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,514
Default converting number to dollar

Claus' suggestion worked for me! I suspect you're not giving us
accurate details about the subject data!!!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #9   Report Post  
Junior Member
 
Posts: 8
Question

That is a very possible conclusion.

I get automated emails with arrest reports. I click on the .htm file to open the web page.

I copy all the data and past into Excel.

The cell comes in as locked and formatted as general.
"Total Bail Amount: 2,508.00*"

I run a macro to resort the data into a workable format, which removes the alpha characters from this field." 2,508.00*" .

Now I just need to format this to currency "$2,508".

It really should be as simple as formatting the cell to currency but it doesn't which is why I came to you guru's. I've done all of your suggestions to the raw data and to the data after I run the macro.

I am sure someone out there knows how to make this work.

Quote:
Originally Posted by GS[_2_] View Post
Claus' suggestion worked for me! I suspect you're not giving us
accurate details about the subject data!!!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,514
Default converting number to dollar

" 2,508.00*"

This is why it doesn't work! Your parsing process needs to strip out
the leading space and trailing asterisk.

Here's a macro that parses the dollar amount from the original
string...

Sub ParseCurrency()
Dim vData, vTmp, n&, lLastCell&
lLastCell = Cells(Rows.Count, Selection.Column).End(xlUp).Row

vData = Selection.Resize(lLastCell, 1)
For n = LBound(vData) To UBound(vData)
vTmp = Split(vData(n, 1), ": ")
vData(n, 1) = Replace(vTmp(1), "*", "")
Next 'n
With Selection.Resize(lLastCell, 1): .Value = vData: .Style =
"Currency": End With
End Sub

...where the original string is like "Total Bail Amount: 2,508.00*" for
each entry. *You must select the first cell of data containing dollar
amounts before running the macro*

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion




  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,514
Default converting number to dollar

A revised version to handle first row not being row 1...

Sub ParseCurrency()
Dim vData, vTmp, n&, lStart&, lEnd&, lCol&
With Selection: lStart = .Row: lCol = .Column: End With
lEnd = Cells(Rows.Count, Selection.Column).End(xlUp).Row

vData = Range(Cells(lStart, lCol), Cells(lEnd, lCol))
For n = LBound(vData) To UBound(vData)
vTmp = Split(vData(n, 1), ": ")
vData(n, 1) = Replace(vTmp(1), "*", "")
Next 'n
With Range(Cells(lStart, lCol), Cells(lEnd, lCol))
.Value = vData: .Style = "Currency"
End With
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
converting number to dollar mytyab Setting up and Configuration of Excel 3 December 31st 20 02:16 PM
convert number to words(like 1.00 = Dollar One Only) Murali Ramadoss Excel Worksheet Functions 1 March 27th 09 07:56 AM
Question For Importing Data Into Excel/Converting General Number to Dollar Amount [email protected] Excel Discussion (Misc queries) 3 February 12th 07 09:30 PM
Converting currency from US Dollar into Canadian dollars from column A to Column B Shahid Ali Excel Worksheet Functions 2 September 6th 06 10:47 PM
Converting 100 cents to 1 dollar Jim333 Excel Worksheet Functions 4 June 1st 05 12:23 PM


All times are GMT +1. The time now is 10:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"