ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Is there any way to speed this up? (https://www.excelbanter.com/excel-programming/379488-there-any-way-speed-up.html)

Keith74

Is there any way to speed this up?
 
Hi

I've got a bit of code that scans through each cell in the first column
of a spreadsheet using the offset method looking for pagebreaks, and
inserting a new line and some text if it finds one. It takes about
20secs to do just 200 rows. I've set application.visible to false and
application.screenupdating to false. Does anyone know of a way i can
speed this process up?

Thanks

Keith


macropod

Is there any way to speed this up?
 
Hi Keith,

That depends on your code - which you haven't posted.

Cheers

--
macropod
[MVP - Microsoft Word]


"Keith74" wrote in message ups.com...
| Hi
|
| I've got a bit of code that scans through each cell in the first column
| of a spreadsheet using the offset method looking for pagebreaks, and
| inserting a new line and some text if it finds one. It takes about
| 20secs to do just 200 rows. I've set application.visible to false and
| application.screenupdating to false. Does anyone know of a way i can
| speed this process up?
|
| Thanks
|
| Keith
|



NickHK

Is there any way to speed this up?
 
Keith,
You can use the HPageBreaks/VPageBreaks collection to see where the occur.
Worksheets(1).HPageBreaks(1).Location.Address

NickHK

"Keith74" wrote in message
ups.com...
Hi

I've got a bit of code that scans through each cell in the first column
of a spreadsheet using the offset method looking for pagebreaks, and
inserting a new line and some text if it finds one. It takes about
20secs to do just 200 rows. I've set application.visible to false and
application.screenupdating to false. Does anyone know of a way i can
speed this process up?

Thanks

Keith




Keith74

Is there any way to speed this up?
 
Hi

Here it is

For intCount = 1 To intTotal

If Worksheets("Summary").Rows(intCount).PageBreak <
xlPageBreakNone _
And ActiveCell.Value < "" Then
Rows(intCount).Select
Selection.Insert Shift:=xlDown
End If

ActiveCell.Offset(1, 0).Select
Next

cheers


Bob Phillips

Is there any way to speed this up?
 
removing the selecting will help

With Worksheets("Summary")

iRow = ActiveCell.Row
iCol = ActiveCell.Column

For intCount = 1 To intTotal

If .Rows(intCount).PageBreak < xlPageBreakNone _
And .Cells(iRow + i - 1, iCol).Value < "" Then

.Rows(intCount).Insert Shift:=xlDown

End If

Next


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Keith74" wrote in message
oups.com...
Hi

Here it is

For intCount = 1 To intTotal

If Worksheets("Summary").Rows(intCount).PageBreak <
xlPageBreakNone _
And ActiveCell.Value < "" Then
Rows(intCount).Select
Selection.Insert Shift:=xlDown
End If

ActiveCell.Offset(1, 0).Select
Next

cheers




Don Guillett

Is there any way to speed this up?
 
Post your code

--
Don Guillett
SalesAid Software

"Keith74" wrote in message
ups.com...
Hi

I've got a bit of code that scans through each cell in the first column
of a spreadsheet using the offset method looking for pagebreaks, and
inserting a new line and some text if it finds one. It takes about
20secs to do just 200 rows. I've set application.visible to false and
application.screenupdating to false. Does anyone know of a way i can
speed this process up?

Thanks

Keith





All times are GMT +1. The time now is 04:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com