Cell data being imported incorrectly

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,226
Office Version
  1. 2007
Platform
  1. Windows
Hi,
On a mileage worksheet in cell C32 i have a value of £23.40
This cell has the formula of =DOLLAR(D31*0.45) so all is ok.

I then run a macro which copies this cell data to another sheet.
Upon that sheet the columns are added up but i see an issue.
In each cell i see this,
Using these as examples,
Cell I30 shows £66.57 address bar shows 66.57 "NO £ SIGN"
Cell I36 shows £259.47 address bar shows 259.47 "NO £ SIGN"

My problem cell I35 is the data from the mileage worksheet.
This cell shows £23.40 address bar shows "£23.40

Because of this my grand total is incorrect as the "£23.40 being shown is not included in the autosum etc.

As a test if i manually type £23.40 in cell I35 problem solved.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
I assume you mean the formula bar when you say address bar.
the simple answer is that the value in the cell is Text-format from excel point of view. Not sure what your code does, but it should only copy the nummeric value, and not include the £-sign into cell itself.

23.40 in the cell is nummeric, and then you can format to SHOW the £.
£23.40 in the cell text and cannot be formated in anyway.

you can try to multiply by 1 to turn it into a number, either by formula or even in the vba code itself.
 
Upvote 0
Yes the formula bar.

The code on the mileage sheet should just copy the value in a specific cell and then paste it into a specific cell on my summary sheet.

When home I will advise the code that is in place so you might see the reason why.
 
Upvote 0
The DOLLAR function returns a text value, hence your problem.
 
Upvote 0
Thanks Fluff
How can this be written another way the =DOLLAR(D31*0.45)

Not sure why DOLLAR is there ?
Maybe just =SUM(D31*0.45) then format the cell to have it show £
What do you think ?
 
Upvote 0
Just =D31*0.45 & format accordingly
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,215,374
Messages
6,124,571
Members
449,173
Latest member
Kon123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top