Bonjour lee, le forum,
Pas sur d'avoir tout compris...
Un essai...
Sub testRAP()
Dim plage As Range, val As String
Dim Wbsource As Workbook, wsDest As Workbook
Dim ShSource As Worksheet, ShDest As Worksheet
Set Wbsource = ThisWorkbook
Set ShSource = Wbsource.Sheets("DATAS")
On Error Resume Next
Set WbDest = Workbooks("rap.xlsm")
Set ShDest = WbDest.Sheets("WH-Analyse")
If Err <> 0 Then
MsgBox "Le classeur" & Chr(10) & Chr(10) & "rap.analyse" & Chr(10) & Chr(10) & "n'est pas ouvert !" & Chr(10) & "Copie impossible.": Exit Sub
Else
On Error GoTo 0
With ShSource
Set plage = .Range("A2:B" & .Range("A" & Rows.Count).End(xlUp).Row)
val = .Range("A2").Value
plage.Copy
End With
With ShDest
.Activate
.Range("A" & .Range("A" & Rows.Count).End(xlUp).Row + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
.Range("A" & .Range("A" & Rows.Count).End(xlUp).Row + 1) = val
.Range("B" & .Range("B" & Rows.Count).End(xlUp).Row + 1) = "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30"
.Columns.AutoFit
End With
End If
Application.CutCopyMode = False
End Sub
Code à placer dans un module du classeur 'raf.xlsm'...
Cordialement,