Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Excel Makro Wertübertragung und PDF Generierung

Empfohlene Antworten

Hallo,

Ich habe Probleme an zwei Stellen in einem Makro. Ziel ist eine Liste von Namen im Sheet “Lists&Refs†in einer Schleife durchzugehen. Bei jedem Durchgang soll der jeweils aktive Name in das Auswahlfeld B2 in Sheet „Prep“ übertragen werden. Hier weiss ich nicht wie ich die gerade aktive Zelle ansprechen kann (ich habe schon mehrere Sachen probiert, siehe grüne Markierung).

Dann ändern sich automatisch die Inhalte einer Reihe von Pivottabellen. Das Resultat ist ein Report auf dem Sheet “Printâ€. Für jeden Namen soll ein eigener PDF report erstellt werden und gespeichert werden. Der Name des PDFs soll immer der Wert in B2 in Sheet “Prep†sein. Wie kann ich die automatische Speicherung unter dem Namen in Zelle B2 bewerkstelligen?

Ziel ist, dass die Speicherung der Reports unter den richtigen Namen automatisch erfolgt.

Vielen Dank für Eure Hilfe.

Lavendela

Sub PDF Creation()

Sheets("Lists&Refs").Activate

Dim x As Integer

NumRows = Range("A5", Range("A5").End(xlDown)).Rows.Count

Range("A5").Select

For x = 1 To NumRows

Sheets("Lists&Refs").Select

ActiveSheet.Paste Destination:=Sheets("Prep").Range("B2")

' Workbooks(Version3).Worksheets("Lists&Refs").Cells(ActiveCell).Copy.

' Destination:=Workbooks(Version3).Worksheets("Prep").Cells("B2").

Sheets("Prep").Activate

Range("B2").Select

ActiveSheet.PivotTables("PivotTable1").PivotFields("Name"). _

ClearAllFilters

ActiveSheet.PivotTables("PivotTable1").PivotFields("Name"). _

CurrentPage = ThisWorkbook.ActiveSheet.Cells(2, 2).Value

ActiveSheet.PivotTables("PivotTable3").PivotFields("Name"). _

ClearAllFilters

ActiveSheet.PivotTables("PivotTable3").PivotFields("Name"). _

CurrentPage = ThisWorkbook.ActiveSheet.Cells(2, 2).Value

ActiveSheet.PivotTables("PivotTable14").PivotFields("Name"). _

ClearAllFilters

ActiveSheet.PivotTables("PivotTable14").PivotFields("Name"). _

CurrentPage = ThisWorkbook.ActiveSheet.Cells(2, 2).Value

ActiveSheet.PivotTables("PivotTable15").PivotFields("Name"). _

ClearAllFilters

ActiveSheet.PivotTables("PivotTable15").PivotFields("Name"). _

CurrentPage = ThisWorkbook.ActiveSheet.Cells(2, 2).Value

ActiveSheet.PivotTables("PivotTable4").PivotFields("Name"). _

ClearAllFilters

ActiveSheet.PivotTables("PivotTable4").PivotFields("Name"). _

CurrentPage = ThisWorkbook.ActiveSheet.Cells(2, 2).Value

ActiveSheet.PivotTables("PivotTable5").PivotFields("Name"). _

ClearAllFilters

ActiveSheet.PivotTables("PivotTable5").PivotFields("Name"). _

CurrentPage = ThisWorkbook.ActiveSheet.Cells(2, 2).Value

ActiveSheet.PivotTables("PivotTable6").PivotFields("Name"). _

ClearAllFilters

ActiveSheet.PivotTables("PivotTable6").PivotFields(" Name"). _

CurrentPage = ThisWorkbook.ActiveSheet.Cells(2, 2).Value

ActiveSheet.PivotTables("PivotTable11").PivotFields(" Name"). _

ClearAllFilters

ActiveSheet.PivotTables("PivotTable11").PivotFields(" Name"). _

CurrentPage = ThisWorkbook.ActiveSheet.Cells(2, 2).Value

ActiveSheet.PivotTables("PivotTable12").PivotFields("Name"). _

ClearAllFilters

ActiveSheet.PivotTables("PivotTable12").PivotFields("Name"). _

CurrentPage = ThisWorkbook.ActiveSheet.Cells(2, 2).Value

Sheets("Print").Select

ActiveSheet.PivotTables("PivotTable14").PivotFields("Name"). _

ClearAllFilters

ActiveSheet.PivotTables("PivotTable14").PivotFields(" Name"). _

CurrentPage = ThisWorkbook.ActiveSheet.Cells(1, 2).Value

Range("Print").Select

Selection.Copy

Range("K9:K51").Select

Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _

SkipBlanks:=False, Transpose:=False

Application.CutCopyMode = False

Application.ActivePrinter = "ScanSoft PDF Create! on Ne00:"

ExecuteExcel4Macro _

"PRINT(1,,,1,,,,,,,,2,""ScanSoft PDF Create! on Ne00:"",,TRUE,,FALSE)"

ActiveCell.Offset(1, 0).Select

Next

End Sub

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.