ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   comparing amounts (https://www.excelbanter.com/excel-programming/402969-comparing-amounts.html)

JT

comparing amounts
 
I am comparing 2 spreadsheets to find identical items. I create a reference
column for each sheet. Each reference number contains the amount of the
item. The sources for the data in each sheet comes from different sources.

One sheet, the amount is a text field and displays as 1,500.00 in the
formula bar and in the cell.

The other sheet is a number field and displays as 1500 in the formula bar
and as 1,500.00 in the cell.

I need to convert the amounts in one sheet so they match the amounts in the
other sheet when shown in the formula bar. Ideally, I would like to convert
the amounts in the second sheet so they display commas and decimal points in
the formula bar.

Any suggestions would be greatly appreciated. Thanks for the help...

--
JT

Otto Moehrbach

comparing amounts
 
JT
The only way I know how to do what you want is to change the value to
text. This macro will do that for all of Column A starting with row 2.
Note that the subsequent values are text, not numbers. HTH Otto
Sub Macro1()
Dim TheRng As Range
Dim i As Range
Dim TheValue As Double
Set TheRng = Range("A2", Range("A" & Rows.Count).End(xlUp))
For Each i In TheRng
TheValue = i.Value
i.ClearContents
i.NumberFormat = "@"
i.Value = Format(TheValue, "#,##0.00")
Next i
End Sub
"JT" wrote in message
...
I am comparing 2 spreadsheets to find identical items. I create a
reference
column for each sheet. Each reference number contains the amount of the
item. The sources for the data in each sheet comes from different
sources.

One sheet, the amount is a text field and displays as 1,500.00 in the
formula bar and in the cell.

The other sheet is a number field and displays as 1500 in the formula bar
and as 1,500.00 in the cell.

I need to convert the amounts in one sheet so they match the amounts in
the
other sheet when shown in the formula bar. Ideally, I would like to
convert
the amounts in the second sheet so they display commas and decimal points
in
the formula bar.

Any suggestions would be greatly appreciated. Thanks for the help...

--
JT





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

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