Thema Datum  Von Nutzer Rating
Antwort
Rot Excel VBA: Funktion zum kopieren und einfügen einer Zelle mit Format
30.06.2021 09:27:54 SmileStyle
NotSolved
30.06.2021 09:47:51 Gast77690
*****
Solved
30.06.2021 10:15:14 Gast58228
Solved
30.06.2021 12:45:44 Gast77690
*****
Solved
30.06.2021 13:13:49 SmileStyle
Solved
30.06.2021 13:28:57 Gast63612
Solved
30.06.2021 13:38:25 SmileStyle
Solved
30.06.2021 15:50:05 Gast53801
Solved
30.06.2021 15:54:31 Gast15246
Solved
01.07.2021 06:43:33 SmileStyle
Solved
01.07.2021 06:54:11 Gast47937
Solved
01.07.2021 07:29:43 Gast65706
NotSolved
01.07.2021 07:45:09 Gast34099
NotSolved
01.07.2021 08:07:22 Gast47668
NotSolved
01.07.2021 09:08:36 SmileStyle
NotSolved
01.07.2021 09:12:26 Gast99709
NotSolved
01.07.2021 09:14:41 Gast94772
NotSolved
01.07.2021 09:21:10 Gast87920
NotSolved
01.07.2021 09:39:12 Gast85319
NotSolved
01.07.2021 10:33:43 Gast41471
NotSolved
01.07.2021 12:05:46 Gast10434
NotSolved
01.07.2021 12:12:12 Gast52314
NotSolved
01.07.2021 13:14:16 SmileStyle
NotSolved
01.07.2021 13:24:40 Gast54171
NotSolved
01.07.2021 13:30:40 SmileStyle
NotSolved
01.07.2021 13:50:26 Gast63143
Solved
01.07.2021 15:13:10 Gast83873
NotSolved
01.07.2021 16:26:36 Gast72071
NotSolved
02.07.2021 06:54:36 SmileStyle
NotSolved
02.07.2021 08:53:29 Gast42440
NotSolved
02.07.2021 09:14:00 Gast54346
NotSolved
05.07.2021 08:46:11 Gast59306
NotSolved
05.07.2021 08:58:10 Gast67636
NotSolved

Ansicht des Beitrags:
Von:
SmileStyle
Datum:
30.06.2021 09:27:54
Views:
1145
Rating: Antwort:
  Ja
Thema:
Excel VBA: Funktion zum kopieren und einfügen einer Zelle mit Format

Guten Morgen,

ich brauche Hilfe. Ich bin relativ neu zur VBA Programmierung gekommen. Bin im Moment an einer Abwesenheitsliste dran.

Hierzu habe ich das Kontextmenü so verändert das auf Rechtsklick die Abwesenheitkürzel erscheinen. Diese habe ich auf dem ersten Tabellenblatt hinterlegt. Nun habe ich das Problem das ich die Formatierung die dort hinterlegt ist über eine Funktion direkt und das Feld schreibe was ich mit Rechtsklick angeklickt habe oder markiert habe.  Habe den Zellen Bereichsnamen gegeben um diese anzusprechen und damit man sie verändern kann.

Code:

Sub Start()
    Dim Ini As Integer
    Dim oBtn As CommandBarButton
    
    ' Menü löschen
    For Ini = CommandBars("Cell").Controls.Count To 1 Step -1
        CommandBars("Cell").Controls(Ini).Delete
    Next Ini
    For Ini = 1 To 25
        With CommandBars("Cell").Controls.Add(Type:=msoControlPopup)
            Select Case Ini
                Case 1
                    .Caption = Range("AbwK1")                         ' Beschriftung RK_1 ist der Bereichsname
                    .OnAction = "Makro1"                                   ' Aktion
                Case 2
                    .Caption = Range("AbwK2")
                    .OnAction = "Makro2"
                Case 3
                    .Caption = Range("AbwK3")
                    .OnAction = "Makro3"
                Case 4
                    .Caption = Range("AbwK4")
                    .OnAction = "Makro4"
                Case 5
                    .Caption = Range("AbwK5")
                    .OnAction = "Makro5"
                Case 6
                    .Caption = Range("AbwK6")
                    .OnAction = "Makro6"
                Case 7
                    .Caption = Range("AbwK7")
                    .OnAction = "Makro7"
                Case 8
                    .Caption = Range("AbwK8")
                    .OnAction = "Makro8"
                Case 9
                    .Caption = Range("AbwK9")
                    .OnAction = "Makro9"
                Case 10
                    .Caption = Range("AbwK10")
                    .OnAction = "Makro10"
                Case 11
                    .Caption = Range("AbwK11")
                    .OnAction = "Makro11"
                Case 12
                    .Caption = Range("AbwK12")
                    .OnAction = "Makro12"
                Case 13
                    .Caption = Range("AbwK13")
                    .OnAction = "Makro13"
                Case 14
                    .Caption = Range("AbwK14")
                    .OnAction = "Makro14"
                Case 15
                    .Caption = Range("AbwK15")
                    .OnAction = "Makro15"
                Case 16
                    .Caption = Range("AbwK16")
                    .OnAction = "Makro16"
                Case 17
                    .Caption = Range("AbwK17")
                    .OnAction = "Makro17"
                Case 18
                    .Caption = Range("AbwK18")
                    .OnAction = "Makro5"
                Case 19
                    .Caption = Range("AbwK19")
                    .OnAction = "Makro5"
                Case 20
                    .Caption = Range("AbwK20")
                    .OnAction = "Makro5"
                Case 21
                    .Caption = Range("AbwK21")
                    .OnAction = "Makro5"
                Case 22
                    .Caption = Range("AbwK22")
                    .OnAction = "Makro5"
                Case 23
                    .Caption = Range("AbwK23")
                    .OnAction = "Makro5"
                Case 24
                    .Caption = Range("AbwK24")
                    .OnAction = "Makro5"
                Case 25
                    .Caption = Range("AbwK25")
                    .OnAction = "Makro5"
            End Select
        End With
    Next Ini
End Sub

Falls mir jemand helfen könnte wäre ich sehr dafür dankbar.

MfG 

SmileStyle


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
Rot Excel VBA: Funktion zum kopieren und einfügen einer Zelle mit Format
30.06.2021 09:27:54 SmileStyle
NotSolved
30.06.2021 09:47:51 Gast77690
*****
Solved
30.06.2021 10:15:14 Gast58228
Solved
30.06.2021 12:45:44 Gast77690
*****
Solved
30.06.2021 13:13:49 SmileStyle
Solved
30.06.2021 13:28:57 Gast63612
Solved
30.06.2021 13:38:25 SmileStyle
Solved
30.06.2021 15:50:05 Gast53801
Solved
30.06.2021 15:54:31 Gast15246
Solved
01.07.2021 06:43:33 SmileStyle
Solved
01.07.2021 06:54:11 Gast47937
Solved
01.07.2021 07:29:43 Gast65706
NotSolved
01.07.2021 07:45:09 Gast34099
NotSolved
01.07.2021 08:07:22 Gast47668
NotSolved
01.07.2021 09:08:36 SmileStyle
NotSolved
01.07.2021 09:12:26 Gast99709
NotSolved
01.07.2021 09:14:41 Gast94772
NotSolved
01.07.2021 09:21:10 Gast87920
NotSolved
01.07.2021 09:39:12 Gast85319
NotSolved
01.07.2021 10:33:43 Gast41471
NotSolved
01.07.2021 12:05:46 Gast10434
NotSolved
01.07.2021 12:12:12 Gast52314
NotSolved
01.07.2021 13:14:16 SmileStyle
NotSolved
01.07.2021 13:24:40 Gast54171
NotSolved
01.07.2021 13:30:40 SmileStyle
NotSolved
01.07.2021 13:50:26 Gast63143
Solved
01.07.2021 15:13:10 Gast83873
NotSolved
01.07.2021 16:26:36 Gast72071
NotSolved
02.07.2021 06:54:36 SmileStyle
NotSolved
02.07.2021 08:53:29 Gast42440
NotSolved
02.07.2021 09:14:00 Gast54346
NotSolved
05.07.2021 08:46:11 Gast59306
NotSolved
05.07.2021 08:58:10 Gast67636
NotSolved