DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Bir tane listbox ekledim ve buna excel sayfasındaki verileri listelettirdim ama hangi sayfasının üzerindeyse ondaki verileri listeliyor listelemenin başka bir yolu varsa yardım edebilirseniz sevinirim.
Private Sub UserForm_Initialize()
Sheets("[COLOR="Red"][B]gelen[/B][/COLOR]").Select
ListBox2.ColumnCount = 9
ListBox2.ColumnWidths = "150;80"
ListBox2.RowSource = "A4:I" & [A65536].End(3).Row
End Sub
Sub sütunkontrol()
Dim X As Long,
For X = 4 To [A:A].Find("*", , , , xlByRows, xlPrevious).Row
If WorksheetFunction.CountIf(Range("EA:EA"), Cells(X, "A")) = 0 Then
.
.
.
.
End If
Next
End Sub
Deneyiniz
Kod:Range("A" & X).select
sub sütunkontrol()
Dim X As Long
For X = 4 To [A:A].Find("*", , , , xlByRows, xlPrevious).Row
If WorksheetFunction.CountIf(Range("EA:EA"), Cells(X, "A")) = 0 Then
Range("A" & X).Select
End If
Next
End Sub
Seçmeyin direk verileri alın.hocam teşekkür ederim cevabınız için fakat kodu denediğim zaman A sütunundaki hep son hücreyi seçiyor acaba kodu yanlış mı yazdım?
Kod:sub sütunkontrol() Dim X As Long For X = 4 To [A:A].Find("*", , , , xlByRows, xlPrevious).Row If WorksheetFunction.CountIf(Range("EA:EA"), Cells(X, "A")) = 0 Then Range("A" & X).Select End If Next End Sub
ben bu kodu listbox içersinde döngü kurdurarak yapacağım ama şuan kod he "A" sütunndaki son veriyi alıyor. Neden acaba gözden kaçırdığım bir noktamı var acaba?
listbox1.additem range("A" & X).value
Seçmeyin direk verileri alın.
Kod:listbox1.additem range("A" & X).value
Aşağıdaki Ekli dosyayı inceleyiniz.![]()
Sheets("sayfa1").Range("A" & ListBox1.ListIndex + 4).Select
Ben anlamadım.
Başka arkadaşlardan yardım almayı bekleyiniz.![]()
Dim z
For z = 4 To [C:C].Find("*", , , , xlByRows, xlPrevious).Row '4. satırdan itibaren "C" hücresi için dolu satır sayısınca döngü yapıyor
Cells(z, "D").Value = Format(Cells(z, "C").Value + 3, "dd.mm.yyyy") ' c sutununa 3 günlük tarihi yazıyor
Next
For z = 4 To [C:C].Find("*", , , , xlByRows, xlPrevious).Row '4. satırdan itibaren "C" hücresi için dolu satır sayısınca döngü yapıyor
Cells(z, "G").Value = Format(Cells(z, "C").Value + 11, "dd.mm.yyyy") ' c sutununa 3 günlük tarihi yazıyor
Next
Dim i, mydate, DUN
mydate = CDate(FormatDateTime(Now, vbShortDate))
DUN = CDate(FormatDateTime((Now - TimeSerial(24, 0, 0)), vbShortDate)) ' bu günden bir gün oncesinin tarihini buluyor dün
For i = 4 To [D:D].Find("*", , , , xlByRows, xlPrevious).Row '4. satırdan itibaren dolu satır sayısınca döngü yapıyor
'MsgBox CDate(FormatDateTime(Cells(i, "C").Value, vbShortDate))
If Cells(i, "F").Value = "" Then
If CDate(FormatDateTime(Cells(i, "D").Value, vbShortDate)) = mydate Or CDate(FormatDateTime(Cells(i, "D").Value, vbShortDate)) = DUN Then
Cells(i, "E").Value = "Takip günü geldi"
Range("A" & i & ":AQ" & i).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535 'seçili hücre rengini sarı yapıyor
.TintAndShade = 0
.PatternTintAndShade = 0
End With
With Selection.Font
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
End With
Selection.Font.Bold = True
Else
If CDate(FormatDateTime(Cells(i, "D").Value, vbShortDate)) > mydate Then
Cells(i, "E").Value = "Takip devam ediyor"
Range("A" & i & ":AQ" & i).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent6
.TintAndShade = -0.249977111117893
.PatternTintAndShade = 0 ' seçili hücre rengini turuncu yapıyor
.TintAndShade = 0
.PatternTintAndShade = 0
End With
With Selection.Font
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
End With
Selection.Font.Bold = True
Else
Cells(i, "E").Value = "Takip günü geçti"
Range("A" & i & ":AQ" & i).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 10498160 ' seçili hücreyi mor yapıyor
.TintAndShade = 0
.PatternTintAndShade = 0
End With
With Selection.Font
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
End With
Selection.Font.Bold = True
End If
End If
End If
Next
Dim n
For n = 4 To [E:E].Find("*", , , , xlByRows, xlPrevious).Row ' 4. satırdan itibaren "E" hücresi için dolu satır sayısınca döngü yapıyor
If Cells(n, "F") = "Aylık takipte" Then Cells(n, "E").Value = ""
If Cells(n, "F") = "Devam etmekte" Then Cells(n, "E").Value = ""
If Cells(n, "F") = "Vazgeçildi" Then Cells(n, "E").Value = ""
If Cells(n, "F") = "Geldi" Then Cells(n, "E").Value = ""
If Cells(n, "F") = "Siparişte" Then Cells(n, "E").Value = ""
Next
Dim a
Sheets("Btck").Range("EA4:EB" & Rows.Count).ClearContents
For a = 1 To [E:E].Find("*", , , , xlByRows, xlPrevious).Row
If Cells(i, "F").Value = "" Then
If Cells(a, 5) = "Takip günü geldi" Then
[ea1048576].End(xlUp).Offset(1, 0) = Cells(a, 1)
[eb1048576].End(xlUp).Offset(1, 0) = Cells(a, 2)
Range(Cells(a, 1), Cells(a, 43)).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535 ' seçilen hücreyi sarı yapıyor
.TintAndShade = 0
.PatternTintAndShade = 0
End With
With Selection.Font
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
End With
End If
End If
Next a
If [EA4] <> "" Then
If [EB4] <> "" Then
MsgBox "Takip edilecek verilerini kontrol et.", vbInformation, "A++"
UserForm4.Show
End If
End If
End Sub