.value = .value doesnt work

jfish1288

Board Regular
Joined
Jun 22, 2011
Messages
116
I am having an issue with this code

Code:
.Range("D9").Value = .Range("I7").Value

Cell I7 is $0.03261. When I run the code it pust $0.03000 in D9. Any thoughts of what is going on or how to put the correct value in D9 other than copy/paste?

Also if I run this code

Code:
MsgBox .Range("I7").Value

It returns the value .0326
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Maybe it is a formatting issue, example

MsgBox format(.Range("I7").Value, ".00000")
 
Last edited:
Upvote 0
I am getting the following compile error:

"Wrong number of arguments or invalid property assignment"

I get the same error when I copy and past the example code from Microsoft Visual Basic Help "Format Function" topic
 
Upvote 0
You should post more of your code, or more description.

You do have the With and End With statements in there somewhere, don't you? Example, in cell I7 of Sheet5 just now, I entered a long decimalized number.

I activated sheet2, then I ran this short macro, with the code line I posted earlier, inside the With structure which is a given but I mention it anyway, and had no problem:

Sub test()
With Sheets("Sheet5")
MsgBox Format(.Range("I7").Value, ".00000")
End With
End Sub
 
Upvote 0
Use:
Code:
.Range("D9").Value2 = .Range("I7").Value2
 
Upvote 0

Forum statistics

Threads
1,224,605
Messages
6,179,860
Members
452,948
Latest member
UsmanAli786

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