Hi Bob,
Thanks for the info.
You're right about the version of Excel - I noticed that this thread falls
under the scope of Mac Excel after I'd posted it.
I sometimes do things in the way you suggest but didn't realise it made
such
a difference. I'll give it a go in the morning and will definitely bear it
in
mind in future if it speeds things up a bit.
Thanks again,
Steve
"Bob Greenblatt" wrote:
> On 5/19/08 10:14 AM, in article
> 3FB58C9A-7A0F-4D29-B9EA-D8C1FC6321D0@[EMAIL PROTECTED]
"Steve McDonald"
<Steve
> McDonald@[EMAIL PROTECTED]
> wrote:
>
> > I'm having a similar problem with a workbook that was working fine
with Excel
> > 2003. I have a simple macro that inserts a new line at the top of a
list and
> > copies the formulae from the previous line (I'm quite lazy!):
> >
> > Sub AddRow()
> > ' Macro recorded 23/03/2006 by dvscm
> > '
> > Rows("3:3").Select
> > Selection.Copy
> > Selection.Insert ****ft:=xlDown
> > Application.CutCopyMode = False
> > Range("A3:E3,l3:m3").Select
> > Selection.ClearContents
> > Range("A3").Select
> > End Sub
> >
> >
> > Now that I'm using Excel 2007, this simple operation takes 17 seconds
to
> > complete. It appears that the insert row takes all the time, even
though the
> > data only covers the range A1:M92 - not exactly a large amount.
> >
> > Can you suggest anything that I can do to speed this up as I've had to
> > resort to anything other than Excel (eg paper and pen!)?
> >
> > Thanks,
> >
> > Steve
> Well you called it Excel 2008 which is a Macintosh version. I think you
> really mean Excel 2007. I'd try a few things. 1)If you can avoid it
NEVER
> select anything in VBA. And 2) Turn off screen refresh. Your macro
ought to
> look like:
> > Sub AddRow()
> > ' Macro recorded 23/03/2006 by dvscm
> > ' and modified by bob Greenblatt
> > Application.screenupdating=false
> > with Rows("3:3")
> > .copy
> > .Insert ****ft:=xldown
> > end with
> > Range("A3:E3,l3:m3").clearcontents
> > Range("A3").Select
> > End Sub
>
> See if this makes any difference.
> --
> Bob Greenblatt [MVP], Macintosh
> bobgreenblattATmsnDOTcom
>
>


|