PC Review


Reply
Thread Tools Rate Thread

copy a from a cell to another with desired format

 
 
pls123
Guest
Posts: n/a
 
      14th May 2010
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
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      14th May 2010
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.


"pls123" <(E-Mail Removed)> wrote in message
news648189E-8645-4555-B37E-(E-Mail Removed)...
> 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



 
Reply With Quote
 
Gary''s Student
Guest
Posts: n/a
 
      14th May 2010
Sub dural()
Set aWS = ActiveSheet
aWS.Range("L80").Value = aWS.Range("J80").Value
aWS.Range("L80").NumberFormat = "0.0000"
End Sub

--
Gary''s Student - gsnu201003
 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      14th May 2010
You accidentally encased your string expression in a CDbl function call; I
believe you meant to post this...

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

--
Rick (MVP - Excel)



"JLGWhiz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
>
> "pls123" <(E-Mail Removed)> wrote in message
> news648189E-8645-4555-B37E-(E-Mail Removed)...
>> 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

>
>

 
Reply With Quote
 
USH
Guest
Posts: n/a
 
      14th May 2010
tx !!
and if i want format as hour ??

HH.MM.SS ??




"Gary''s Student" wrote:

> Sub dural()
> Set aWS = ActiveSheet
> aWS.Range("L80").Value = aWS.Range("J80").Value
> aWS.Range("L80").NumberFormat = "0.0000"
> End Sub
>
> --
> Gary''s Student - gsnu201003

 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      14th May 2010
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.


"Rick Rothstein" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You accidentally encased your string expression in a CDbl function call; I
> believe you meant to post this...
>
> aWS.Range("L80").NumberFormat = "#,##0.0000"
>
> --
> Rick (MVP - Excel)
>
>
>
> "JLGWhiz" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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.
>>
>>
>> "pls123" <(E-Mail Removed)> wrote in message
>> news648189E-8645-4555-B37E-(E-Mail Removed)...
>>> 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

>>
>>



 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      14th May 2010
Most of this stuff is in the VBE help files, in case the MS server goes
down.


"USH" <(E-Mail Removed)> wrote in message
news:8DEC3A58-C37F-444F-8D45-(E-Mail Removed)...
> tx !!
> and if i want format as hour ??
>
> HH.MM.SS ??
>
>
>
>
> "Gary''s Student" wrote:
>
>> Sub dural()
>> Set aWS = ActiveSheet
>> aWS.Range("L80").Value = aWS.Range("J80").Value
>> aWS.Range("L80").NumberFormat = "0.0000"
>> End Sub
>>
>> --
>> Gary''s Student - gsnu201003



 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      14th May 2010
How many of us are there? <g>


Gord

On Fri, 14 May 2010 17:50:41 -0400, "JLGWhiz" <(E-Mail Removed)> wrote:

>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.
>
>
>"Rick Rothstein" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>> You accidentally encased your string expression in a CDbl function call; I
>> believe you meant to post this...
>>
>> aWS.Range("L80").NumberFormat = "#,##0.0000"
>>
>> --
>> Rick (MVP - Excel)
>>
>>
>>
>> "JLGWhiz" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> 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.
>>>
>>>
>>> "pls123" <(E-Mail Removed)> wrote in message
>>> news648189E-8645-4555-B37E-(E-Mail Removed)...
>>>> 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
>>>
>>>

>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to: copy value from active sheet to all other sheets with VBA (in desired cell) DVAL Microsoft Excel Programming 3 15th Dec 2010 01:38 AM
Copy worksheet1 to worksheet2, keep cell format eg cell size slocookie Microsoft Excel Misc 2 8th Jan 2010 11:24 AM
Lock Cell Format - Allow copy and paste of data without format change Chris12InKC Microsoft Excel Worksheet Functions 1 11th Mar 2006 04:44 AM
How do I copy data in single cell format to a merged cell format =?Utf-8?B?UGF1bA==?= Microsoft Excel Misc 1 27th Jun 2005 11:00 AM
How to get desired format in textbox linked to a cell NoSpam@aol.com Microsoft Excel Programming 3 14th Jan 2004 02:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:16 AM.