brunoricardo
New Member
- Joined
- Aug 1, 2013
- Messages
- 20
Hello everyone,
The code below aims to copy several sets of columns and past them into another sheet. How can i say that I just want to start the information to be pasted on the column "F"? I think is something to be with the definition of my dimension "s"...
thanks in advance!!
Sub Copy_Over2()
Application.ScreenUpdating = False
Dim i As Integer
Dim b As Integer
Dim s As Integer
Dim Lastrow As Long
Dim Lastrow2 As Long
Sheets("Sheet1").Activate
For i = 3 To 6
s = s + 1
Lastrow = Cells(Rows.Count, i).End(xlUp).Row + 1
Lastrow2 = Sheets("Sheet2").Cells(Rows.Count, s).End(xlUp).Row + 1
For b = 2 To Lastrow
Sheets("Sheet2").Cells(Lastrow2, s).Value = Cells(b, i).Value
Lastrow2 = Lastrow2 + 1
Next
Next
Application.ScreenUpdating = True
End Sub
The code below aims to copy several sets of columns and past them into another sheet. How can i say that I just want to start the information to be pasted on the column "F"? I think is something to be with the definition of my dimension "s"...
thanks in advance!!
Sub Copy_Over2()
Application.ScreenUpdating = False
Dim i As Integer
Dim b As Integer
Dim s As Integer
Dim Lastrow As Long
Dim Lastrow2 As Long
Sheets("Sheet1").Activate
For i = 3 To 6
s = s + 1
Lastrow = Cells(Rows.Count, i).End(xlUp).Row + 1
Lastrow2 = Sheets("Sheet2").Cells(Rows.Count, s).End(xlUp).Row + 1
For b = 2 To Lastrow
Sheets("Sheet2").Cells(Lastrow2, s).Value = Cells(b, i).Value
Lastrow2 = Lastrow2 + 1
Next
Next
Application.ScreenUpdating = True
End Sub