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.

CommandButton in neuer Zeile erzeugen

Empfohlene Antworten

Veröffentlicht

Hi Leute!

Ich habe in meiner Tabelle einen Commandbutton! In der Tabelle stehen in den Zeilen der Spalte A Ziffern von 1 bis 6! Wenn er gedrückt wird erzeugt er eine neue Zeile unterhalb der zeile mit dem Eintrag "4". In dieser neuen Zeile wird dann ein Link zu einer Datei angelegt und ein CommandButton erzeugt.

Hier ist der Code:

Private Sub CommandButton1_Click()

    Dim i As Long

    Dim temp As Long


    i = Cells(Rows.Count, 1).End(xlUp).Row

    Do Until Cells(i, 1) = "4"

    i = i - 1

    Loop

    temp = i + 1


    Rows(temp).Insert (xlShiftDown)


    Range("B" & temp).Select

    ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="105.xls", TextToDisplay:="LINK"

    Selection.Font.ColorIndex = 0

    Selection.Font.Underline = xlUnderlineStyleNone


    Set a = Range("A" & temp)


    With ActiveSheet.OLEObjects.Add(ClassType:="Forms.CommandButton.1", Link:=False, _

        DisplayAsIcon:=False, Left:=a.Left + 50, Top:=a.Top, Width:=10, _

        Height:=10).Object

    End With


End Sub

Aus mir nicht erklärlichen Gründen werden, sowohl der Button als auch der Hyperlink, nur bei jedem zweiten Aufruf erzeugt!

Kann mir da mal jemand helfen?

Danke

Mit freundlichem Gruß

Paulus2408

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.