copy a from a cell to another with desired format

P

pls123

hi all i need to make this copy..

aWS.Range("L80").Value = aWS.Range("J80").Value

but with format with 4 decimals...
can anybody help ?
tx! paolo
 
J

JLGWhiz

Assuming you want numeric:

aWS.Range("L80").Value = aWS.Range("J80").Value
aWS.Range("L80").NumberFormat = CDbl("#,##0.0000")

But Excel will clip all zeros on the right of any digit of value.
 
G

Gary''s Student

Sub dural()
Set aWS = ActiveSheet
aWS.Range("L80").Value = aWS.Range("J80").Value
aWS.Range("L80").NumberFormat = "0.0000"
End Sub
 
R

Rick Rothstein

You accidentally encased your string expression in a CDbl function call; I
believe you meant to post this...

aWS.Range("L80").NumberFormat = "#,##0.0000"
 
J

JLGWhiz

No, that is just the stupid in me that shows up now and then. I have no
idea what I was thinking. But I can always blame it on senility.
 
G

Gord Dibben

How many of us are there? <g>


Gord

No, that is just the stupid in me that shows up now and then. I have no
idea what I was thinking. But I can always blame it on senility.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top