Hello.. How can I copy data without formatting? Copy values only
VBA Code:
Sub Bouton1_Cliquer()
Dim LastRowF1 As Integer
Dim NextRowF2 As Integer
Dim RowCount As Integer
Dim rngF1 As Range
' For my testing
Dim Feuil1 As Worksheet, Feuil2 As Worksheet
Set Feuil1 = Worksheets("sheet1")
Set Feuil2 = Worksheets("sheet2")
With Feuil1
NextRowF2 = Feuil2.Cells(Rows.Count, 6).End(xlUp).Row + 1
If NextRowF2 < 7 Then NextRowF2 = 7 '<--- Change this to the default starting row
LastRowF1 = .Cells(Rows.Count, 2).End(xlUp).Row
Set rngF1 = .Range(.Cells(7, "D"), .Cells(LastRowF1, "i"))
RowCount = rngF1.Rows.Count
Feuil2.Cells(NextRowF2, "c").Resize(RowCount, rngF1.Columns.Count).Value = rngF1.Value
' Copy Parameters including format
.Range("f2").Copy Destination:=Feuil2.Cells(NextRowF2, "B").Resize(RowCount)
.Range("F2").Copy Destination:=Feuil2.Cells(NextRowF2, "j").Resize(RowCount)
.Range("a2").Copy Destination:=Feuil2.Cells(NextRowF2, "i").Resize(RowCount)
.Range("c4").Copy Destination:=Feuil2.Cells(NextRowF2, "k")
Range("a2").Select
End With
End Sub