Çalışmak için bir döngü oluşturmaya çalışıyorum.VBA Sayfadan geçirme ve doğruluğunu kontrol etme
Gerçekleştirmem gereken şey, bir sayfanın üstesinden gelmek ve adresin tüm sütun örnekleri W sütununda GoTo end_nothing
değerine sahipse, A sütununda W adresi bir değere sahipse, W sütununda bir değer varsa. Sadece bazı eşlemeler W sütunundaki verilere sahipse alt ile devam edin.
Kodumla yaşadığınız sorun, eşleştiği ilk girdinin, geri kalanı üzerinde döngü olmadan alttan çıkmasıdır.
Benim Kod:
Private Sub CommandButton3_Click()
Dim add_WIR_check, lastRow_WIR As Long
Dim address_Check As String: address_Check = sheets("Auto Checklist").cells(3, 2).value
lastRow_WIR = sheets("Works Instruction Record").cells(Rows.count, "A").End(xlUp).Row
***** Unprotect Sheet
For add_WIR_check = 3 To lastRow_WIR
If sheets("Works Instruction Record").cells(add_WIR_check, 1) = address_Check Then
If sheets("Works Instruction Record").cells(add_WIR_check, 23) <> "" Then
GoTo end_nothing
End If
End If
Next add_WIR_check
***** Additional code here
end_nothing:
***** Protect sheet
End Sub
Bu Alex, bu mükemmel çalıştı ve çok hızlı çalışır! Gerçekten de yardımı takdir ediyorum! – atame
Bir şey değil. Projenize iyi şanslar. Saygılarımla, –