Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
1192to1196
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

Makro beim speichern ausführen

Makro beim speichern ausführen
Andre
Hi Leute,
kurze Frage, was mache ich falsch? Ich möchte beim speichern das verschiedene Makros ausgeführt werden, sobald "active" in der entsprechenden Zelle steht. Aber irgendie klappt es nicht.
Vielen Dank im voraus.
Gruss
Andre
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If MsgBox("Do you really want to save", vbYesNo, ActiveWorkbook.Name) = vbYes Then
If (Setupentry.Range("B09")) = "active" Then
Run "categoryfulfillment"
Run "regionsfulfillment"
Run "KPI"
If (Setupentry.Range("B10")) = "active" Then
Run "countmeasures"
If (Setupentry.Range("B11")) = "active" Then
Run "uniquekey"
If (Setupentry.Range("B12")) = "active" Then
Run "riskcalculationforsavings"
If (Setupentry.Range("B13")) = "active" Then
Run "checkforreporting"
Application.StatusBar = ActiveWorkbook.Name & " is saves with changes"
Else
Cancel = True
End If
End If
End If
End If
End If
End If
End Sub

3
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Benutzer
Anzeige
AW: Makro beim speichern ausführen
11.01.2011 16:49:24
Andre
hi Leute,
hat jetzt geklappt, habe die End if gleich nach jeder If Satz gestellt.
Gruss
Andre
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If MsgBox("Do you really want to save", vbYesNo, ActiveWorkbook.Name) = vbYes Then
If (Setupentry.Range("B10")) = "active" Then
Run "categoryfulfillment"
Run "regionsfulfillment"
Run "KPI"
End If
If (Setupentry.Range("B11")) = "active" Then
Run "countmeasures"
End If
If (Setupentry.Range("B12")) = "active" Then
Run "uniquekey"
End If
If (Setupentry.Range("B13")) = "active" Then
Run "riskcalculationforsavings"
End If
If (Setupentry.Range("B14")) = "active" Then
Run "checkforreporting"
End If
Application.StatusBar = ActiveWorkbook.Name & " is saves with changes"
Else
Cancel = True
End If
End Sub

Anzeige
AW: Makro beim speichern ausführen
11.01.2011 17:11:41
Reinhard
Hallo Andre,
du rückst falsch ein.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If MsgBox("Do you really want to save", vbYesNo, ActiveWorkbook.Name) = vbYes Then
If (Setupentry.Range("B10")) = "active" Then
Run "categoryfulfillment"
Run "regionsfulfillment"
Run "KPI"
End If
If (Setupentry.Range("B11")) = "active" Then
Run "countmeasures"
End If
If (Setupentry.Range("B12")) = "active" Then
Run "uniquekey"
End If
If (Setupentry.Range("B13")) = "active" Then
Run "riskcalculationforsavings"
End If
If (Setupentry.Range("B14")) = "active" Then
Run "checkforreporting"
End If
Application.StatusBar = ActiveWorkbook.Name & " is saves with changes"
Else
Cancel = True
End If
End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If MsgBox("Do you really want to save", vbYesNo, ActiveWorkbook.Name) = vbYes Then
If (Setupentry.Range("B10")) = "active" Then
Run "categoryfulfillment"
Run "regionsfulfillment"
Run "KPI"
End If
If (Setupentry.Range("B11")) = "active" Then Run "countmeasures"
If (Setupentry.Range("B12")) = "active" Then Run "uniquekey"
If (Setupentry.Range("B13")) = "active" Then Run "riskcalculationforsavings"
If (Setupentry.Range("B14")) = "active" Then Run "checkforreporting"
Application.StatusBar = ActiveWorkbook.Name & " is saves with changes"
Else
Cancel = True
End If
End Sub

Gruß
Reinhard
Anzeige
AW: Makro beim speichern ausführen
12.01.2011 10:36:56
Andre
Hi Reinhard,
danke für deine Hilfe. Klappt jetzt.
Gruss
Andre

309 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige