bonjour
j ai une erreur dans mon code
Sub Import2()
Dim nodeb As Long
Dim nofin As Long
Dim moi As String
moi = ActiveWorkbook.Name
Dim LeNom As String
Application.Dialogs(xlDialogOpen).Show
If ActiveWorkbook.Name = moi Then
MsgBox "Base abandonnée!"
Exit Sub
End If
LeNom = ActiveWorkbook.Name
nodeb = InputBox("Ligne de debut ?", "identification", "2")
nofin = InputBox("Ligne de fin ?", "identification", "6500")
Range("A2").Select
ActiveWorkbook.ActiveSheet.Range("D,L,Q" & nodeb & "D,L,Q" & nofin).Copy
With Workbooks(moi).Sheets("Base")
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
End With
Workbooks(LeNom).Close
Sheets("Base").Select
End Sub
Ci joint le fichier
le but : copier des colonnes d un fichier et les coller ( valeurs seules) dans l'onglet base .
j ai une erreur dans mon code
Sub Import2()
Dim nodeb As Long
Dim nofin As Long
Dim moi As String
moi = ActiveWorkbook.Name
Dim LeNom As String
Application.Dialogs(xlDialogOpen).Show
If ActiveWorkbook.Name = moi Then
MsgBox "Base abandonnée!"
Exit Sub
End If
LeNom = ActiveWorkbook.Name
nodeb = InputBox("Ligne de debut ?", "identification", "2")
nofin = InputBox("Ligne de fin ?", "identification", "6500")
Range("A2").Select
ActiveWorkbook.ActiveSheet.Range("D,L,Q" & nodeb & "D,L,Q" & nofin).Copy
With Workbooks(moi).Sheets("Base")
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
End With
Workbooks(LeNom).Close
Sheets("Base").Select
End Sub
Ci joint le fichier
le but : copier des colonnes d un fichier et les coller ( valeurs seules) dans l'onglet base .