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 31 32 33
|
'Creation of a new book
Workbooks.Add
'Get the workbook name
newbook = ActiveWorkbook.name
'Create the summary sheet
Sheets.Add After:=Sheets(Sheets.Count)
ActiveSheet.name = "SUMMARY"
'TITRE + FONT
Range("E1").Select
Selection.Value = "Summary"
summary_row = 3 'first line of the summary
'Creation of the customer sheet
Sheets.Add After:=Sheets(Sheets.Count)
'initialization of the customer sheet name
namesheet = Workbooks(oldbook).Sheets("General Information").Cells(deb, colitem).Value
ActiveSheet.name = namesheet
'add a link in the summary sheet
Workbooks(newbook).Sheets("SUMMARY").Cells(summary_row, 2).Value = Workbooks(oldbook).Sheets("General Information").Cells(deb, colname).Value
'Partie qui, si supprimée, règle le problème.
Workbooks(newbook).Sheets("SUMMARY").Hyperlinks.Add Anchor:=Workbooks(newbook).Sheets("SUMMARY").Cells(summary_row, 2), Address:="", SubAddress:= _
namesheet & "!A1", TextToDisplay:=Workbooks(oldbook).Sheets("General Information").Cells(deb, colname).Value
'Selection qui va provoquer l'erreur
Range("I1:K1,D3:I5,A8:E8,G8:K8,G9:K13,B15:D15,G15:K15,G16:K16,G17:K17,G18:K18,G19:K19,G20:K20,A17:E17,A19:E19,A22:K22").Select |
Partager