1

Topic: In the ready project to accelerate or simplify macro operation

Children Hello! Whenever possible! Who can! In my project VB6, macro VBA but as you can is implemented will be convinced, at start of this macro there is an operation of "turtle" how probably to accelerate macro process? I will be very grateful in the help or instructions of a way of the decision.
p/s. The last line  for this purpose that the file would not be saved and it was not required new, at an output simply not to save.

2

Re: In the ready project to accelerate or simplify macro operation

And  to process all sheet. Define Range in which there is data, and work only with square-topped ranges.

3

Re: In the ready project to accelerate or simplify macro operation

Akina why I process all sheet? The matter is that I initially do not know where and in what line or what cells , here on it I and select all

4

Re: In the ready project to accelerate or simplify macro operation

ActiveSheet. Cells. SpecialCells (xlCellTypeLastCell) nobody cancelled...

5

Re: In the ready project to accelerate or simplify macro operation

... As, however, and.UsedRange.

6

Re: In the ready project to accelerate or simplify macro operation

assei;
Braking in the core happens because a command

.Selection. AutoFill Destination: =. ActiveSheet. Range ("E:E"), Type: = 0 ' we remove the filter

fills with the formula all column. Delete it, and in the previous command define the last line on 4, instead of on 1 column.
Was:

.Range ("E1").Select ' we select a cell
.Range ("E1:E" AND.Cells (.Rows. Count, 1).End (-4162).Row).Formula = _
"=OR (LEFT (RC [-4]) =" "No" ", LEFT (R [1] Cs [-4]) =" "No" ")" ' we install the formula
.Selection. AutoFill Destination: =. ActiveSheet. Range ("E:E"), Type: = 0 ' we remove the filter

Became:

.Range ("E1:E" AND.Cells (.Rows. Count, 4).End (-4162).Row).Formula = _
"=OR (LEFT (RC [-4]) =" "No" ", LEFT (R [1] Cs [-4]) =" "No" ")" ' we install the formula

It is desirable to get rid also from Select and Selection, esteem http://www.sql.ru/faq/faq_topic.aspx?fid=4344
But also so the strong brakes any more will not be.

7

Re: In the ready project to accelerate or simplify macro operation

Kazan, smartly! The code decreased at least time in two, prompt as it is possible to reduce it:

With xlp. Application. Range ("A1:C200") ' the macro removes the drawn boundaries in a range
.Borders (5).LineStyle =-4142
.Borders (6).LineStyle =-4142
.Borders (7).LineStyle =-4142
.Borders (8).LineStyle =-4142
.Borders (9).LineStyle =-4142
.Borders (10).LineStyle =-4142
.Borders (11).LineStyle =-4142
.Borders (12).LineStyle =-4142
End With

8

Re: In the ready project to accelerate or simplify macro operation

Found a way out, as that so:

xlp. Application. Range ("A1:C200").Borders. LineStyle =-4142