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] Neue Zeile einfügen lassen und Formeln übernehmen

Empfohlene Antworten

Veröffentlicht

Guten Morgen,

ich möchte gern, ein Button erstellen, der mir nach einem Wort (Suche -> "Wort") x Zellen einfügt. Schön und gut, das habe ich auch schon:

Sub test()


Dim z As Variant

z = Application.InputBox _

("Geben Sie die Anzahl der einzufügenden Zeilen ein.", _

"Zeilen einfügen", "6", , , , , 2)

For x = 1 To z

Cells.Find(What:="Ende", After:=ActiveCell, LookIn:=xlFormulas, LookAt _

        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _

        False, SearchFormat:=False).Activate

Selection.EntireRow.Insert

Next x


End Sub

Jetzt möchte ich allerdings, dass er die Formeln, welche über den eingefügten Zeilen stehen, mit übernimmt. Habe leider keinerlei Ahnung wie ich das realisieren kann. :/

Wäre für Hilfe sehr dankbar.

Liebe Grüße

Moritz

  • Autor

Für jeden der es evtl. zukünftig mal braucht, hier die Lösung:


Sub test()


Dim z As Variant

z = Application.InputBox _

("Geben Sie die Anzahl der einzufügenden Zeilen ein.", _

"Zeilen einfügen", "", , , , , 2)

For x = 1 To z

Cells.Find(What:="Ende", After:=ActiveCell, LookIn:=xlFormulas, LookAt _

        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _

        False, SearchFormat:=False).Activate

Selection.EntireRow.Insert


x_end = Selection.Address

Selection.End(xlUp).Select

Selection.Copy

Range(Selection.Address, x_end).Select

ActiveSheet.Paste

Application.CutCopyMode = False


Next x


End Sub

Liebe Grüße

Moritz

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.