The index does not belong to the selection

Solved
sabw -  
 sabw -
Hello,

Here is the macro
Sub Macro124RDMTPE()

Dim mavar As Long
Dim mavard As Long
Dim mavard1 As Long
mavar = Sheets("Variable macro").Range("B1").Value
mavard = Sheets("Variable macro").Range("B3").Value
mavard1 = Sheets("Variable macro").Range("B4").Value
Sheets("124 Feuil").Select
Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(5, 1), Array(10, 1), Array(16, 9), Array(17, 1), _
Array(24, 1), Array(32, 9), Array(69, 1), Array(75, 1), Array(81, 1), Array(87, 9), Array( _
101, 1), Array(107, 1), Array(113, 1), Array(119, 9), Array(133, 1), Array(139, 1), Array( _
145, 1), Array(151, 9), Array(220, 1), Array(226, 1), Array(232, 1), Array(238, 9), Array( _
453, 9)), TrailingMinusNumbers:=True
Range("1:9").Select
Selection.Delete Shift:=xlUp
Sheets("2017 124 W" & CStr(mavard) & " to " & CStr(mavard1)).Select

and I have in the last line the message 'the index does not belong to the selection', I don't know what that means other than it doesn't bug every time.
Can someone help me please?

2 réponses

f894009 Posted messages 17417 Registration date   Status Membre Last intervention   1 717
 
Hello,

When you have the error, click on debugging, hover the mouse cursor over the variables on the line with the error to see their content, and you will be able to diagnose where the error comes from.
1