online 1
gast (50)

/ Forum / Tabellenkalkulation

TabellenkalkulationTabellenkalkulation

Fragevon Martin123 vom 05.09.2020, 07:16 Options

Makro auf mehrere Blätter anwenden

Hallo zusammen,

habe folgendes Makro(Auszug), das ich gerne auf mehrere Blätter anwenden möchte. Bisher funktioniert es nur, wenn ich es auf jedes einzelne Blatt anwende. Hier werden Werte aus Spalte I mit denen aus Spalte G verglichen. Steht in Spalte I ein Wert, werden die Zellen F,G,H durchgestrichen.
Hoffe ihr habt Ideen.

Option Explicit

Public Sub vergleichen()
Dim lngI As Long, intWert As Integer
Application.ScreenUpdating = False
For lngI = 1 To Cells(Rows.Count, 1).End(xlUp).Row
intWert = Application.WorksheetFunction. _
CountIf(Worksheets("11.15").Range("I:I"), Cells(lngI, 7).Value)
If intWert > 0 Then
Cells(lngI, 6).Font.Strikethrough = True
Cells(lngI, 7).Font.Strikethrough = True
Cells(lngI, 8).Font.Strikethrough = True
End If
Next lngI
For lngI = 1 To Cells(Rows.Count, 1).End(xlUp).Row
intWert = Application.WorksheetFunction. _
CountIf(Worksheets("11.35").Range("I:I"), Cells(lngI, 7).Value)
If intWert > 0 Then
Cells(lngI, 6).Font.Strikethrough = True
Cells(lngI, 7).Font.Strikethrough = True
Cells(lngI, 8).Font.Strikethrough = True
End If
Next lngI
Application.ScreenUpdating = True
End Sub


Antwort schreiben

Antwort 21 von Martin123 vom 10.09.2020, 09:47 Options

Hallo Rainer,

habe deinen Code aus 9 mit Änderungen aus 10 in ein allgemeines Modul eingefügt und es funktioniert soweit. Mit der Änderung in Antwort 19 habe ich es nicht zum Laufen gebracht.
Danke für die Hilfe.

Gruß martin

Antwort 22 von rainberg vom 10.09.2020, 11:50 Options

Hallo Martin,

das Makro ist in Deiner Datei getestet und läuft.

Wenn es bei Dir nicht läuft, hast Du nicht beachtet, was ich Dir geschrieben habe.

Gruß
Rainer

Antwort 23 von Martin123 vom 10.09.2020, 12:19 Options

Hallo Rainer,

meinte damit eigentlich, dass alles so ist wie es sein soll. Die Datei komplett abgedeckt.

Gruß
Martin

Ähnliche Themen

excel2000 Blätter in bestehende Arbeitsmappe einfügen
kati2  21.06.2007 - 103 Hits - 1 Antwort

excel-umbenannte Blätter - Verknüpfung
forestrot  21.08.2007 - 25 Hits - 1 Antwort

Eingabe auf Formel anwenden
Fighter_XP  08.09.2007 - 41 Hits - 1 Antwort

Verschieben von Zeilen in Blätter mit Namensprinzip
XpressMe  30.11.2007 - 58 Hits - 3 Antworten

Datumsabfrage über mehrere Blätter
090365  17.12.2007 - 80 Hits - 27 Antworten

Hinweis

Diese Frage ist schon etwas älter, Sie können daher nicht mehr auf sie antworten. Sollte Ihre Frage noch nicht gelöst sein, stellen Sie einfach eine neue Frage im Forum..

Neue Einträge

Version: supportware 1.9.150 / 10.06.2022, Startzeit:Mon Jan 26 09:21:55 2026