Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
N+ N+ is offline
external usenet poster
 
Posts: 34
Default cpu saving..

hi evrybody !! can anybody make this code more economic for my cpu?? (it is
not a big problem, but maybe there is something better)
ty..!! this is part of code of a macro called every 2 seconds..

aWS.Range("H7").Value = aWS.Range("H1").Value
aWS.Range("H7").Copy
aWS.Range("A1").Insert Shift:=xlDown
aWS.Range("H7").Copy
aWS.Range("A1").Insert Shift:=xlDown

aWS.Range("A801").Delete Shift:=xlUp


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default cpu saving..

Why do you copy H7 twice and do nothing with it.

Why do you insert two cells, but only delete one cell

what are you trying to do?

Maybe
With aWS
.Range("A1:A799").copy .Range("A2")
.Range("A1,H7").Value = .Range("H1").Value
End With

--
Regards,
Tom Ogilvy




--
Regards,
Tom Ogilvy


"N+" wrote:

hi evrybody !! can anybody make this code more economic for my cpu?? (it is
not a big problem, but maybe there is something better)
ty..!! this is part of code of a macro called every 2 seconds..

aWS.Range("H7").Value = aWS.Range("H1").Value
aWS.Range("H7").Copy
aWS.Range("A1").Insert Shift:=xlDown
aWS.Range("H7").Copy
aWS.Range("A1").Insert Shift:=xlDown

aWS.Range("A801").Delete Shift:=xlUp


  #3   Report Post  
Posted to microsoft.public.excel.programming
N+ N+ is offline
external usenet poster
 
Posts: 34
Default cpu saving..

hi tom ty for help, there is a noticeable save of cpu and also more
manuevrability when switchin from1 window to other, whene there is a lot of
winows open.

1) i forgot to write the "delete" twice, u have reason..
2) i copy twice because the macro runs evry 2 seconds to save the cpu.. so i
have to shift down twice (to respect "seconds/rows" proportion..have a link
in another page ) .. i can just copy once, having 1 blank cell and 1 filled,
its true (with is a little cpu save)
3)sorry for disturbing you again the original code has a "if then" choice ,
for the base cell..and i can't translate to the new situation..!! help me if
u can , ty!

If aWS.Range("H1").Value = "0" Then
aWS.Range("H7").Copy
aWS.Range("A1").Insert Shift:=xlDown
'aWS.Range("H7").Copy
aWS.Range("A1").Insert Shift:=xlDown
Else
aWS.Range("H7").Value = aWS.Range("H1").Value
aWS.Range("H7").Copy
aWS.Range("A1").Insert Shift:=xlDown
'aWS.Range("H7").Copy
aWS.Range("A1").Insert Shift:=xlDown
End If

aWS.Range("A801").Delete Shift:=xlUp
aWS.Range("A801").Delete Shift:=xlUp





"Tom Ogilvy" wrote:

Why do you copy H7 twice and do nothing with it.

Why do you insert two cells, but only delete one cell

what are you trying to do?

Maybe
With aWS
.Range("A1:A799").copy .Range("A2")
.Range("A1,H7").Value = .Range("H1").Value
End With

--
Regards,
Tom Ogilvy




--
Regards,
Tom Ogilvy


"N+" wrote:

hi evrybody !! can anybody make this code more economic for my cpu?? (it is
not a big problem, but maybe there is something better)
ty..!! this is part of code of a macro called every 2 seconds..

aWS.Range("H7").Value = aWS.Range("H1").Value
aWS.Range("H7").Copy
aWS.Range("A1").Insert Shift:=xlDown
aWS.Range("H7").Copy
aWS.Range("A1").Insert Shift:=xlDown

aWS.Range("A801").Delete Shift:=xlUp


  #4   Report Post  
Posted to microsoft.public.excel.programming
N+ N+ is offline
external usenet poster
 
Posts: 34
Default cpu saving..

ty tom i did it placing twice this..
..Range("A1:A799").copy .Range("A2")

ty for teaching that useful way for copy paste, i appreciated very much!!
hope we will meet again


"N+" wrote:

hi tom ty for help, there is a noticeable save of cpu and also more
manuevrability when switchin from1 window to other, whene there is a lot of
winows open.

1) i forgot to write the "delete" twice, u have reason..
2) i copy twice because the macro runs evry 2 seconds to save the cpu.. so i
have to shift down twice (to respect "seconds/rows" proportion..have a link
in another page ) .. i can just copy once, having 1 blank cell and 1 filled,
its true (with is a little cpu save)
3)sorry for disturbing you again the original code has a "if then" choice ,
for the base cell..and i can't translate to the new situation..!! help me if
u can , ty!

If aWS.Range("H1").Value = "0" Then
aWS.Range("H7").Copy
aWS.Range("A1").Insert Shift:=xlDown
'aWS.Range("H7").Copy
aWS.Range("A1").Insert Shift:=xlDown
Else
aWS.Range("H7").Value = aWS.Range("H1").Value
aWS.Range("H7").Copy
aWS.Range("A1").Insert Shift:=xlDown
'aWS.Range("H7").Copy
aWS.Range("A1").Insert Shift:=xlDown
End If

aWS.Range("A801").Delete Shift:=xlUp
aWS.Range("A801").Delete Shift:=xlUp





"Tom Ogilvy" wrote:

Why do you copy H7 twice and do nothing with it.

Why do you insert two cells, but only delete one cell

what are you trying to do?

Maybe
With aWS
.Range("A1:A799").copy .Range("A2")
.Range("A1,H7").Value = .Range("H1").Value
End With

--
Regards,
Tom Ogilvy




--
Regards,
Tom Ogilvy


"N+" wrote:

hi evrybody !! can anybody make this code more economic for my cpu?? (it is
not a big problem, but maybe there is something better)
ty..!! this is part of code of a macro called every 2 seconds..

aWS.Range("H7").Value = aWS.Range("H1").Value
aWS.Range("H7").Copy
aWS.Range("A1").Insert Shift:=xlDown
aWS.Range("H7").Copy
aWS.Range("A1").Insert Shift:=xlDown

aWS.Range("A801").Delete Shift:=xlUp


Reply
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
Saving as XML Gavin Bird Excel Discussion (Misc queries) 0 August 15th 11 04:20 AM
Automaticly saving formula's to values when saving Gunti Excel Discussion (Misc queries) 8 November 11th 08 09:34 AM
Saving a spreadsheet without saving the Macro tedd13 Excel Programming 7 March 31st 06 02:17 PM
Saving a Workbook: Forcing User to Rename before Saving Rollin_Again[_6_] Excel Programming 5 April 16th 04 02:54 PM
Saving Changes abxy[_51_] Excel Programming 2 April 12th 04 10:37 PM


All times are GMT +1. The time now is 10:17 PM.

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"