Private Sub
Workbook_Open() MsgBox ("Mappe wurde geöffnet.") End Sub |
Private Sub
Workbook_Open() Dim HelloMsg 'speichert den Text für die Nachricht HelloMsg = "Hallo Welt!" MsgBox HelloMsg, vbOKOnly + vbCritical, "Begrüßungsfeld" End Sub |
Buttons | ||
---|---|---|
vbOKOnly | 0 | nur OK (default) |
vbOKCancel | 1 | OK, Abbrechen |
vbAbortRetryIgnore | 2 | Abbrechen, Wiederholen,Ignorieren |
vbYesNoCancel | 3 | Ja, Nein, Abbrechen |
vbYesNo | 4 | Ja, Nein |
vbRetryCancel | 5 | Wiederholen, Abbrechen |
Symbole | ||
vbCritical | 16 | kritischer Hinweis |
vbQuestion | 32 | Fragezeichen |
vbExclamation | 48 | Warnung |
vbInformation | 64 | Information |
Sub Makro1() ' ' Makro1 Makro ' Makro am ... von ... aufgezeichnet ' ' Tastenkombination: Strg+b ' Range("A1").Select ActiveCell.FormulaR1C1 = "a" Range("A2").Select ActiveCell.FormulaR1C1 = "b" Range("A3").Select ActiveCell.FormulaR1C1 = "c" Range("A4").Select ActiveCell.FormulaR1C1 = "d" Range("A5").Select End Sub |
Sub Makro1() ' ' Tastenkombination: Strg+b ' Range("A1").FormulaR1C1 = "a" Range("A2").FormulaR1C1 = "b" Range("A3").FormulaR1C1 = "c" Range("A4").FormulaR1C1 = "d" Range("A5").Select End Sub |
Sub Makro1() ' ' Tastenkombination: Strg+b ' Range("A1").Value = "a" Range("A2").Value = "b" Range("A3").Value = "c" Range("A4").Value = "d" Range("A5").Select End Sub |
Sub Makro1() ' ' Tastenkombination: Strg+b ' Range("A1") = "a" Range("A2") = "b" Range("A3") = "c" Range("A4") = "d" Range("A5").Select End Sub |
Sub Aggregation() Sheets("Aggregation").Select Range("B5") = "A" Range("C5") = "B" Range("D5") = "C" Range("E5") = "D" 'Selektierer Sheets("Tabelle1").Select Range("B6:E6").Select Selection.Copy Sheets("Aggregation").Select Range("B6").Select ActiveSheet.Paste Range("A6") = Sheets("Tabelle1").Name 'Referenzierer Worksheets("Tabelle2").Range("B6:E6").Copy Worksheets("Aggregation").Range("B7") Worksheets("Aggregation").Range("A7") = Sheets("Tabelle2").Name 'Selektierer mit etwas verkürzter Variante (Mischung aus beiden Stilen) Sheets("Tabelle3").Select Range("B6:E6").Select Selection.Copy Worksheets("Aggregation").Range("B8") Worksheets("Aggregation").Range("A8") = Sheets("Tabelle3").Name Worksheets("Aggregation").Range("B5:E5").HorizontalAlignment = xlRight Worksheets("Aggregation").Activate End Sub |