Nur Werte kopieren, ohne Formatierung der Zellen
Sabine
ich brauche nun doch noch einmal Euren Rat bzw. Eure Hilfe. Wie bekomme ich es in untenstehendem Code hin, dass er aus dem Bereich A20:A23 nur den Zelleninhalt übernimmt und nicht die Formatierung der Zellen wie z.B. die Rahmen? Ganz lieben Dank schonmal für Eure Hilfe.
Viele Grüße Sabine
Private Sub CommandButton3_Click()
Dim wsQuelle, wsZiel As Worksheet
Dim lgSpalteQuelle, lgZeileQuelle As Long
Dim lgSpalteZiel, lgZeileZiel, lgMaxZeile As Long
Set wsQuelle = ThisWorkbook.Worksheets("Teilnehmer Manöver")
Set wsZiel = ThisWorkbook.Worksheets("Tabelle1")
lgSpalteQuelle = 1 '
lgZeileQuelle = 20
lgSpalteZiel = 3
lgZeileZiel = 15
lgMaxZeile = wsZiel.Rows.Count
Do While True
If wsZiel.Cells(lgZeileZiel, lgSpalteZiel).Formula = "" Then
wsQuelle.Range("A20:A23").Copy Destination:=wsZiel.Cells(lgZeileZiel, lgSpalteZiel)
Exit Do
End If
lgZeileZiel = lgZeileZiel + 1
If lgZeileZiel > lgMaxZeile Then
MsgBox "keine frei Zelle gefunden"
Exit Do
End If
Loop
End Sub
Anzeige