StartPozStroka = 9
EndPozStroka = 21
StartPozKolonka = 67
EndPozKolonka = 75
For i = StartPozStroka To EndPozStroka
For j = StartPozKolonka To EndPozKolonka
If j = EndPozKolonka Then
If i = EndPozStroka Then
NewstartStroka = EndPozStroka
NewStartKolonka = EndPozKolonka
Else
NewstartStroka = i + 1
NewStartKolonka = StartPozKolonka
End If
Else
NewstartStroka = i
NewStartKolonka = j + 1
End If
MemYacheika = Range(Chr(j) + CStr(i)).Value
If MemYacheika <> "" Then
If Not (NewstartStroka = EndPozStroka And NewStartKolonka = EndPozKolonka) Then
For n = NewstartStroka To EndPozStroka
If n = NewstartStroka Then
RealStart = NewStartKolonka
Else
RealStart = StartPozKolonka
End If
For m = RealStart To EndPozKolonka
If MemYacheika = Range(Chr(m) + CStr(n)).Value Then
Range(Chr(m) + CStr(n)).Interior.Color = 500
Range(Chr(m) + CStr(n)).Interior.Pattern = xlSolid
End If
Next m
Next n
End If
End If
Next j
Next i
Социальные закладки