hi everyone i need help in VBA...i need to copy from sheet1 the cells T3;U3;DC37;DC41;DC45 to sheet2 and past them in B2;B3;B4;B5;B6 then when i make another copy i need to past the new data in the last row...to keep a record.thanks for the help.
Sub t()
Dim sh1 As Worksheet, sh2 As Worksheet, rng As Variant
Set sh1 = Sheets(1) 'Edit sheet name
Set sh2 = Sheets(2) 'Edit sheet name
With sh1
rng = Array(.Range("T3"), .Range("U3"), .Range("DC37"), .Range("DC41"), .Range("DC45"))
End With
For i = LBound(rng) To UBound(rng)
sh2.Cells(i + 2, 2) = rng(i)
Next
End Sub
B2:B6 is vertical, if you want B2:F2 Thenit works but the data in sheet2 appears vertical...i need horizontal
can you solve it?
and one more thin when i enter new data it deletes de first entry and update...doesnt keep the first registry.
sh2.Cells(i + 2, 2) = rng(i)
sh2.Cells(2, i + 2) = rng(i)