copy a from a cell to another with desired format

  • Thread starter Thread starter pls123
  • Start date Start date
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
 
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.
 
Sub dural()
Set aWS = ActiveSheet
aWS.Range("L80").Value = aWS.Range("J80").Value
aWS.Range("L80").NumberFormat = "0.0000"
End Sub
 
You accidentally encased your string expression in a CDbl function call; I
believe you meant to post this...

aWS.Range("L80").NumberFormat = "#,##0.0000"
 
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.
 
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.
 
Back
Top