Ah ha, ho provato a scansarmela ma mi hai beccato...
Se ho capito bene, la precedente Sub CopiaInterni1 diventa:
- Codice: Seleziona tutto
Sub CopiaInterni121()
Dim r As Long
Dim cRuota As String, ColRuota, ColSpan As Long
'
Sheets("Archivio").Select
r = ActiveCell.Row 'mi metto sulla riga 2193 quindi r avrà valore 2193
Sheets("OUTPUT").Range("A1").CurrentRegion.ClearContents 'per prima cosa cancello quello che c'è nel foglio OUTPUT
cRuota = Application.InputBox("Ruota da Selezionare (una oppure TUTTE)", "Scelta Ruota", , , , , , 2)
If UCase(cRuota) = "TUTTE" Then
ColRuota = 4: ColSpan = 11 * 5
Else
ColSpan = 5
ColRuota = Application.Match(cRuota, Range("A1:BZ1"), False)
If IsError(ColRuota) Then
MsgBox ("Ruota non trovata: " & cRuota)
Exit Sub
End If
End If
Sheets("OUTPUT").Range("A1").Resize(1, 3).Value = Range("A1").Resize(1, 3).Value
Sheets("OUTPUT").Range("D1").Resize(1, ColSpan).Value = Cells(1, ColRuota).Resize(1, ColSpan).Value
If r > 180 Then vres = (180 - 1) Else vres = r - 2
Sheets("OUTPUT").Range("A2").Resize(vres + 1, 3).Value = Cells(r - vres, 1).Resize(vres + 1, 3).Value
Sheets("OUTPUT").Range("D2").Resize(vres + 1, ColSpan).Value = Cells(r - vres, ColRuota).Resize(vres + 1, ColSpan).Value
End Sub
Un InputBox consente di indicare la ruota da scegliere, oppure "Tutte"
Ne approfitto per dire che trovo un po' autolesionistico usare come abbreviazione per il lancio di una macro la combinazione Contr+z, visto che questa abbreviazione corrisponde all'utilissimo comando "Annulla" di Excel.
Ciao