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.

Empfohlene Antworten

Veröffentlicht

hallo,

ich hoffe, es kann mir jemand zu folgendem problem einen tipp geben:

ich habe mehrere abfragen, die wöchentlich nach excel exportiert und dann per email verschickt werden sollen. der export nach excel ansich ist kein problem, das hab ich mit der AusgabeIn-Funktion über ein makro gelöst. da die zahl der abfragen aber immer weiter steigt, will ich nicht jede abfrage in ein einzelnes excel-file ausgeben, sondern alle in ein file aber auf verschiedene tabellenblätter.

gibt es dafür in access eine möglichkeit (per makro oder auch per vba)?

Hier ist mal ein kleines Beispiel. Dort wird zwar eine Datei zur Bearbeitung geöffnet aber eine neue Datei anlegen sollte ähnlich gehen.


Sub Excel_aktivieren()
Dim Excel As New Excel.Application
Dim Wbk As Excel.Workbook
Dim Wks As Excel.Worksheet

Meldung = SysCmd(acSysCmdSetStatus, "Excel wird gestartet...") 'Meldung in der Statusleiste ausgeben
Set Wbk = Excel.Workbooks.Open(Pfad_Datei)
Set Wks = Wbk.Worksheets(1)

'Excel sichtbar machen
Excel.Visible = True
Excel.StatusBar = "Tabelle wird formatiert..."

'Spalten rechts anordnen
Excel.Range("D:M").Select
Excel.Selection.HorizontalAlignment = xlRight
Excel.Selection.VerticalAlignment = xlBottom
Excel.Range("A:A").Select
Excel.Selection.HorizontalAlignment = xlRight
Excel.Selection.VerticalAlignment = xlBottom

'Überschriften eintragen
Excel.Range("A1").Select
Excel.Range("A1").Font.Bold = True
Excel.Range("A1").Value = "Feld1"
Excel.Range("B1").Value = ""
Excel.Range("C1").Value = ""
Excel.Range("D1").Value = "Feld2"
Excel.Range("D1").Font.Bold = True
Excel.Range("E1").Value = ""
Excel.Range("F1").Value = ""
Excel.Range("G1").Value = ""

Excel.Range("B2:C2").Select
Excel.Selection.Merge 'Zellen verbinden
Excel.Selection.HorizontalAlignment = xlCenter
Excel.Selection.VerticalAlignment = xlBottom

Excel.Range("B3:G3").Select
Excel.Selection.HorizontalAlignment = xlCenter
Excel.Selection.VerticalAlignment = xlBottom

Excel.StatusBar = "Spalten werden formatiert..."
'Spaltengröße automatisch einstellen
Excel.Columns("A:A").EntireColumn.AutoFit
Excel.Columns("B:B").EntireColumn.AutoFit
Excel.Columns("C:C").EntireColumn.AutoFit
Excel.Columns("E:E").EntireColumn.AutoFit
Excel.Columns("G:G").EntireColumn.AutoFit

Excel.StatusBar = "Seite wird eingerichtet..."
'Druckeinstellungen vornehmen
With Excel.ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
Excel.ActiveSheet.PageSetup.PrintArea = ""
With Excel.ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = "Seite &P von &N"
.RightFooter = ""
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
End With
Excel.Range("A1").Select

Excel.StatusBar = "Tabelle wird gespeichert..."
'Datei speichern
Wbk.Save

Excel.StatusBar = "Excel wird beendet..."
'Datei schließen
Wbk.Close

'Excel schlißen
Excel.Quit
Set Excel = Nothing

End Sub
[/code]

Frank

hab das problem inzwischen gelöst. es gibt auch die möglichkeit, das ganze über ein makro zu machen, "TransferArbeitsblatt" heißt das ganze.

danke für deine hilfe.

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.