VBA Code .value2 = .value2 copying currency as number stored as text

excelnat

New Member
Joined
May 8, 2014
Messages
12
Hi guys,

I have a line of VBA code where I copy a row of values (text, dates, numbers and currency) to another workbook:

Code:
ActiveSheet.Range("A65536").End(xlUp).Resize(, 16).Offset(1, 0).Value2 = ThisWorkbook.Sheets("COPY").Range("C55:R55").Value2

Where column L and N are currency values.

However, when it copies across, it goes as 'number stored as text' on the currency figures?! Although, it is still formatted as currency and the whole column is formatted as currency.

Can anyone help with how to stop it from storing the currency as text please? (as it interferes with a later code to sum the currency columns!!)

Thanks,
ExcelNat
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Are you sure columns L and N are actually stored as numbers in the source worksheet, and not text?
 
Upvote 0
Are you sure columns L and N are actually stored as numbers in the source worksheet, and not text?

Hi Rory,
On the source workbook, the values are not numbers stored as text, but they are formulas formatted to show currency, if that makes any difference? As I'm trying to get the evaluation of that formula copied to the destination workbook without the formula.
ExcelNat :-)
 
Upvote 0
What are the formulas (do they use the TEXT function)? If the destination worksheet columns aren't formatted as text, the formulas must be returning text.
 
Upvote 0
What are the formulas (do they use the TEXT function)? If the destination worksheet columns aren't formatted as text, the formulas must be returning text.

Ah-ha! Thank you for your help! It was the fact that the formula was linked to an ActiveX Textbox value, which, after some research, seems to convert values to text (even though I had a LostFocus event on the textbox to convert the figure to currency), so I've changed the formula in the source workbook to point to the Value() of that textbox and it now copies across correctly.
 
Upvote 0

Forum statistics

Threads
1,223,635
Messages
6,173,479
Members
452,516
Latest member
archcalx

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