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 zusammen,

ich habe ein Problem mit meinem Code.

Und zwar möchte ich dass er die Werte, die er in das andere Tabellenblatt kopiert mit dem Format kopiert. Also manche Zellen sind mit Farbe hinterlegt oder fett geschrieben...

Hier ist der Code:

Sub Test()

For e = 3 To 12 'Tabellen 3-12 durchlaufen

For x = 1 To Sheets(e).Range("C65536").End(xlUp).Row 'Tabelle Zeile 1 bis Ende

i = Sheets(2).Range("C65536").End(xlUp).Row + 1 'Erste freie Zeile Tabelle1

If Sheets(e).Range("C" & x).Value > 0 Then 'Nur wenn F>0 Zeile übertagen

Sheets(2).Range("A" & i & ":IV" & i).Value = Sheets(e).Range("A" & x & _

":IV" & x).Value 'Zeile übertragen

End If

If i = "65536" Then 'Wenn Tabelle1 voll dann Abbruch

MsgBox "Voll"

Exit Sub

End If

Next

Next

MsgBox "Fertig"

End Sub

Wäre Super wenn einer ne Lösung hätte

Danke

Hat hier denn keiner eine Idee =(

evtl hilft dir das weiter

Set Bereich = ActiveSheet.UsedRange

With Bereich.Borders(xlEdgeLeft)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic

End With

With Bereich.Borders(xlEdgeTop)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic

End With

With Bereich.Borders(xlEdgeBottom)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic

End With

With Bereich.Borders(xlEdgeRight)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic

End With

With Bereich.Borders(xlInsideVertical)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic

End With

With Bereich.Borders(xlInsideHorizontal)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic

End With

End Sub

Leider bin ich nicht so bewandert mit dem Thema, muss ich etwas mit dem Code ersetzten? Bzw. was genau macht denn der Code?

Danke

der code zeichnet einen rahmen um den bereich, indem etwas steht;

hat jetzt direkt mit deinem problem nix zu tun, aber so in der art solltest du es auch lösen können;

wie genau, weis ich jetzt auch nicht auf anhieb, sorry

google sollte doch aber helfen, oder nicht?

Also wenn du auf deiner Quellzelle die Methode Copy anwendest und auf deiner Zielzelle dann die Methode Paste, bzw bei einem Range-Objekt die PasteSpecial, benutzt, wird der Inhalt + Formatierung kopiert.

Danke für den Tip, funktioniert gut, bis auf dass die Summen nicht angezeigt werde, Es wird nur #BEZUG angezeigt.

Kann ich da noch irgendwas umstellen?

Naja ich denke mal dass wird daran liegen, dass die Formel die in der Zelle drin stand jetzt mitkopiert wird und dann im neuen Tabellenblatt in den vorher definierten Zellen nicht die richtigen Eingabewerte bekommt...

Da fällt mir jetzt nur ein, die Zelle erst zu kopieren, und wenn du wirklich nur den Wert haben willst und dir die Formel egal ist. Danach den Wert von der Quellzelle in die Zielzelle einzufügen wie du es vorher schon gemacht hast.

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.