PC Review


Reply
Thread Tools Rate Thread

cpu saving..

 
 
N+
Guest
Posts: n/a
 
      7th Jul 2008
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 With Quote
 
 
 
 
Tom Ogilvy
Guest
Posts: n/a
 
      8th Jul 2008
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 With Quote
 
N+
Guest
Posts: n/a
 
      8th Jul 2008
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 With Quote
 
N+
Guest
Posts: n/a
 
      8th Jul 2008
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 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
Excel 2000 Standard not saving data when saving file D.Watt Microsoft Excel Crashes 0 5th Dec 2007 03:53 PM
saving a workbook, naming it and saving it to a specific path MJKelly Microsoft Excel Programming 2 19th Aug 2007 09:37 PM
C# and EXCEL question saving a file saving the the first column as read only mathieu cupryk Microsoft C# .NET 0 6th Jan 2005 10:19 PM
EXCEL question saving a file saving the the first column as read only Luis Esteban Valencia Microsoft ASP .NET 0 6th Jan 2005 07:02 PM
Saving DataTable to session vs saving a Custom object. John Kandell Microsoft ASP .NET 4 10th Dec 2004 05:08 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:23 AM.