ho modificato la formula x adattarla al mio faglio facendo delle modifiche per copiare solo i valori ma non funziona... mi dareste una mano? sul foglio di prova k vi ho mandato funzionava ma sul mio no... mi da un debug al quarto for - "For w = 1 To Cells(x, 8) 'per tot volte"...
Sub Trasferisci()
Range("B47:AAA72").Clear
Dim x As Long, y As Long, c As Long, r As Long, w As Long
'If Cells(5, 2) = "" Then MsgBox "Inserisci valori in B5:B8"
r = 27 'incollo sotto tot righe
For x = 21 To 45 'intendo da riga 5 a riga 8
c = 2 ''qual'è la prima colonna?
For y = 1 To 1 'intendo quante volte
For w = 1 To Cells(x, 2) 'per tot volte
Cells(x, y + 2).Copy
Cells(x + r, c).PasteSpecial
c = c + 1
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next w
For w = 1 To Cells(x, 4) 'per tot volte
Cells(x, y + 4).Copy
Cells(x + r, c).PasteSpecial
c = c + 1
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next w
For w = 1 To Cells(x, 6) 'per tot volte
Cells(x, y + 6).Copy
Cells(x + r, c).PasteSpecial
c = c + 1
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next w
For w = 1 To Cells(x, 8) 'per tot volte
Cells(x, y + 8).Copy
Cells(x + r, c).PasteSpecial
c = c + 1
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next w
Next y
Next x
Application.CutCopyMode = False
End Sub
sul foglio k allego va bene anche se li non ho provato ad incollare solo valori.. lo allego
[Modificato da carminep 03/04/2020 17:39]