Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Anzeige
Inhaltsverzeichnis

Spalte A ändern in B

Forumthread: Spalte A ändern in B

Spalte A ändern in B
Kai
Hallo,
ich habe diesen Code aus dem Internet, möchte aber statt die Spalte A die Spalte B auf doppelte überprüfen. was muss ich da ändern ?
Danke
Option Explicit

Public Sub Doppelte_Rot()
Dim lngZeile As Long
Dim lngZeilenSprung As Long
Dim strSuchwert As String
lngZeile = Cells(Rows.Count, 1).End(xlUp).Row
For lngZeilenSprung = lngZeile To 1 Step -1
strSuchwert = Cells(lngZeilenSprung, 1).Value
If Application.WorksheetFunction.CountIf(Range(Cells(1, 1), Cells(lngZeile, 1)),  _
strSuchwert)  1 Then
Cells(lngZeilenSprung, 1).Interior.ColorIndex = 3
End If
Next lngZeilenSprung
End Sub

Anzeige

2
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Benutzer
Anzeige
Cells-Spaltenindex 1 --> 2 Gruß owT
08.01.2011 22:03:58
Luc:-?
:-?
AW: Spalte A ändern in B
08.01.2011 22:06:57
Andre´
Hallo Kai
Public Sub Doppelte_Rot()
Dim lngZeile As Long
Dim lngZeilenSprung As Long
Dim strSuchwert As String
lngZeile = Cells(Rows.Count, 2).End(xlUp).Row
For lngZeilenSprung = lngZeile To 1 Step -1
strSuchwert = Cells(lngZeilenSprung, 2).Value
If Application.WorksheetFunction.CountIf(Range(Cells(1, 2), Cells(lngZeile, 2)), _
strSuchwert)  1 Then
Cells(lngZeilenSprung, 2).Interior.ColorIndex = 3
End If
Next lngZeilenSprung
End Sub

MFG Andre
Anzeige
Anzeige
Anzeige
Live-Forum - Die aktuellen Beiträge
Datum
Titel
14.05.2026 13:31:09
14.05.2026 09:50:42
13.05.2026 19:14:18