LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default Copy Range to new Range and keep DATE format??

Still not working here, get exactly the same result...

I truly dont understand this.

Why only a couple cells are affected??

On Jul 12, 3:27*pm, Dave Peterson wrote:
This is just assigning the values. *It doesn't touch the format.

Since you don't want to do copy|paste in your code, you could try this:

Dim SourceRng As Range
Dim DestCell As Range

With Sheets("Settings")
* *Set SourceRng = .Cells(10, TempWeekRange).Resize(6, 1)
* *Set DestCell = .Cells(3, TempWeekRange)
End With

With SourceRng
* *DestCell.Resize(.Rows.Count, .Columns.Count).NumberFormat = .NumberFormat
* *DestCell.Resize(.Rows.Count, .Columns.Count).Value = .Value
End With

==========
But I think you're in for a disappointment. *Most macros that do anything will
kill the clipboard. *This did for me.





" wrote:

Hi,


I know about the copy and paste, but why


Sheets("Settings").Range(TempWeekRange + "3" + ":" + TempWeekRange +
"8").Value = *Sheets("Settings").Range(TempWeekRange + "10" + ":" +
TempWeekRange + "15").Value


doesnt work when both ranges have the same format??


On Jul 12, 1:47 pm, Dave Peterson wrote:
You can.


But this isn't doing any copy or paste.


Record a macro when you do it manually and you'll have the code you need.


" wrote:


On Jun 29, 3:14 pm, " wrote:
Sorry I meant:


*Sheets("Settings").Range(TempWeekRange + "3").Value = _
*FORMAT(Sheets("Settings").Range(TempWeekRange + "10").Value,"dd/mmm/
yyyy")


Why cant I copy between the range and keep the date format without
excel messing it up?


--


Dave Peterson


--

Dave Peterson


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find Last cell in Range when range is date format default105 Excel Discussion (Misc queries) 5 July 7th 09 03:11 PM
Stubborn date format and range copy Mathieu Excel Programming 2 August 21st 07 04:16 PM
copy date based on date -refer to date range mindpeace[_4_] Excel Programming 1 June 3rd 06 01:30 PM
How to copy a range with same format !! tttoan Excel Programming 1 May 26th 05 02:14 PM
Find date and copy range based on that date avzundert Excel Programming 2 November 25th 04 10:31 AM


All times are GMT +1. The time now is 01:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"