Blog Archive
About Me
Com tecnologia do Blogger.
Seguidores
Estatisticas
2006-12-03
Se pretendermos copiar um determinado range de uma Sheet para uma outra Sheet, mas para a linha vazia seguinte e mantendo dados em outras células da mesma linha onde se pretendem colar os dados, como no exemplo seguinte:



Podemos utilizar o seguinte Código num CommandButton:
Private Sub CommandButton1_Click()
Range(ActiveCell, ActiveCell.Offset(0, 3)).Copy Destination:= _
Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
End Sub
Nota: Neste exemplo, torna-se necessário que a ActiveCell seja sempre uma célula da coluna "A"
Podemos utilizar o seguinte Código num CommandButton:
Private Sub CommandButton1_Click()
Range(ActiveCell, ActiveCell.Offset(0, 3)).Copy Destination:= _
Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
End Sub
Nota: Neste exemplo, torna-se necessário que a ActiveCell seja sempre uma célula da coluna "A"