1

Topic: Whether probably to make

Dear help please, whether probably to make: In line  at presence a word to delete That data   was deleted only. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 . Hours Night Prazd. Norm. And those people which more low, rose with all data (,  there was no blank line) Removal all the line long does not approach! Thankful in advance!

2

Re: Whether probably to make

4 8 15 16 23 42

3

Re: Whether probably to make

At me so it turned out... Perhaps who prompts more beautiful variant

Option Explicit
Public Const PervajaStrokaDannyh As Integer = 6
Public Const PoslednjajaStrokaDannyh As Integer = 20
Public Const PervyjStolbetsDannyh As Integer = 2
Public Const PoslednijStolbetsDannyh As Integer = 38
Sub DelStr ()
Dim sRange As String
Dim i As Integer
Dim r As Range
' we Search for a line for removal and we form a line of a range
For i = PervajaStrokaDannyh To of PoslednjajaStrokaDannyh
If Cells (i, PervyjStolbetsDannyh) = to "Delete" Then
sRange = sRange AND IIf (Len (sRange) = 0, "" ",") _
& Split (Cells (i, PervyjStolbetsDannyh).Address, "$") (1) _
& CStr (i) AND ":" _
& Split (Cells (i, PoslednijStolbetsDannyh).Address, "$") (1) _
& CStr (i)
End If
Next i
' it is deleted/is cleaned
If sRange <> "" Then
' we delete cells of a range with shift upwards
Range (sRange).Delete Shift: = xlUp
' we correct numbering in the first column
Range (Cells (PervajaStrokaDannyh, 1), Cells (PoslednjajaStrokaDannyh, 1)).ClearContents
' we put initial 
Cells (PervajaStrokaDannyh, 1) = 1
Cells (PervajaStrokaDannyh + 1, 1) = 2
' we search for actually last filled line
i = Cells (PervajaStrokaDannyh, PervyjStolbetsDannyh).End (xlDown).Row
' we form a range
sRange = Split (Columns (1).Address, "$") (2) and CStr () _
& ":" AND Split (Columns (1).Address, "$") (2) AND CStr (i)
' we put down numbering
If sRange <> "" Then
Set r = Worksheets ("Sheet").Range (Cells (PervajaStrokaDannyh, 1), Cells (PervajaStrokaDannyh + 1, 1))
r. AutoFill Destination: = Worksheets ("sheet").Range (sRange), Type: = xlFillDefault
End If
End If
End Sub

4

Re: Whether probably to make

Generally if removal it fulfill from the end to the beginning, rather the reverse is supposed.

5

Re: Whether probably to make

Akina;
I delete all at once. And I search from the beginning by the end
Better with  help http://www.sql.ru/forum/1236896/kak-per … a-ribbon-e
big_smile