PC Review


Reply
Thread Tools Rate Thread

Clearcontents takes long, long, time

 
 
Fid
Guest
Posts: n/a
 
      14th Aug 2007
I have some very simple code:

With Workbooks("Barcoded_Inv_2007_07.xlsm").Sheets("Raw_Data")

..Range("A3:AA50000").ClearContents

End With

This code has been running over ten minutes and has maxed out the
processor. Ctrl-break will not stop it. Automatic calculation is
turned off.

There is data in A3:AA:XXXXX

I just need to erase all the formulas and values in that range so I
can write new data there.

Thanks,

Brent

 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      14th Aug 2007
Hi Fid

Set Calculation to manual before you run the code line

Application.Calculation = xlCalculationManual

And after that set it back

Application.Calculation =xlCalculationAutomatic


Do you have Event code also in the workbook ?
Then disable this also when you run your code



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Fid" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
>I have some very simple code:
>
> With Workbooks("Barcoded_Inv_2007_07.xlsm").Sheets("Raw_Data")
>
> .Range("A3:AA50000").ClearContents
>
> End With
>
> This code has been running over ten minutes and has maxed out the
> processor. Ctrl-break will not stop it. Automatic calculation is
> turned off.
>
> There is data in A3:AA:XXXXX
>
> I just need to erase all the formulas and values in that range so I
> can write new data there.
>
> Thanks,
>
> Brent
>

 
Reply With Quote
 
KLZA
Guest
Posts: n/a
 
      14th Aug 2007
Is there data all the way to row 50000? If not, you may want to
change it to less than 50000. depending on your processor, memory and
apps you have running it may hang that long. Try this

Sub Macro1()
Range("A3:AA50000").Select
Range("AA50000").Activate
Selection.ClearContents
End Sub

On Aug 14, 3:26 pm, Fid <unclemuf...@gmail.com> wrote:
> I have some very simple code:
>
> With Workbooks("Barcoded_Inv_2007_07.xlsm").Sheets("Raw_Data")
>
> .Range("A3:AA50000").ClearContents
>
> End With
>
> This code has been running over ten minutes and has maxed out the
> processor. Ctrl-break will not stop it. Automatic calculation is
> turned off.
>
> There is data in A3:AA:XXXXX
>
> I just need to erase all the formulas and values in that range so I
> can write new data there.
>
> Thanks,
>
> Brent



 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      15th Aug 2007
Check your other thread, too.

Fid wrote:
>
> I have some very simple code:
>
> With Workbooks("Barcoded_Inv_2007_07.xlsm").Sheets("Raw_Data")
>
> .Range("A3:AA50000").ClearContents
>
> End With
>
> This code has been running over ten minutes and has maxed out the
> processor. Ctrl-break will not stop it. Automatic calculation is
> turned off.
>
> There is data in A3:AA:XXXXX
>
> I just need to erase all the formulas and values in that range so I
> can write new data there.
>
> Thanks,
>
> Brent


--

Dave Peterson
 
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
Deleting block of text takes a long, long, LONG time Nessie Microsoft Word Document Management 1 11th Jun 2009 03:14 PM
Vista takes a long time from start to long in on SBS2003 network...... mlai Windows Vista Networking 6 28th Jun 2007 11:09 PM
Print Window takes long, long time to open =?Utf-8?B?dGVyaQ==?= Microsoft Outlook Discussion 4 27th Sep 2005 08:56 PM
PC with XP SP2 takes long long time to log onto windows 2000 domai =?Utf-8?B?U2lt?= Windows XP General 0 18th Aug 2004 02:39 AM
Windows Explorer takes a long long time opening any folder yt855 Windows XP General 2 2nd Mar 2004 11:55 PM


Features
 

Advertising
 

Newsgroups
 


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