LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default ActiveCell.PasteSpecial (xlPasteValues) hangs program

I have a worksheet with formula that auto-eneters the date (NOW()),
based on the value of another cell. The cell is either todays date, or
an emopty string.

==IF(I26=0,NOW(),"")

When exiting the sheet I want to convert any dates entered to thier
literal value (i.e remove the formula) so that the date is not
overwritten with a future date when the sheet is reopened.

This code works, but takes a very long time , and when stepping
through I see it hangs for several seconds on each call to
pastespecial, making it take over 10 minutes for 3000 rows.

Any reason for this - is thier a faster way to achieve the same
result?
thanks,hals_left

For Each Cell In Worksheets(1).Range("myRange")
If IsDate(Cell.Value) Then
Cell.Select
Cell.Copy

ActiveCell.PasteSpecial (xlPasteValues)
End If
Next
 
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
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
2007 - Program Hangs when Viewing Worksheets Deanna Reynolds Excel Discussion (Misc queries) 0 October 14th 06 09:47 PM
pastespecial Claude Excel Programming 2 February 24th 04 01:21 PM
pastespecial in vba cornishbloke[_13_] Excel Programming 7 December 31st 03 01:02 PM
merging excel program with tdc finance program judy Excel Programming 0 November 5th 03 08:01 PM


All times are GMT +1. The time now is 12:30 AM.

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

About Us

"It's about Microsoft Excel"