Eurekaonide
Active Member
- Joined
- Feb 1, 2010
- Messages
- 422
Hi
Please can you help my code is not working.
I want it to work through the rows and columns and if the cell is blank move on to the next cell, if that cell is not blank copy the data and paste it into cell K1, K2 etc.
Dropping down a row each time it finishes.
My range of data is ever changing in length but always the same number of columns (5) so A - E
The second set of data will start in K1 onwards and downwards.
Thanks in advance
Please can you help my code is not working.
I want it to work through the rows and columns and if the cell is blank move on to the next cell, if that cell is not blank copy the data and paste it into cell K1, K2 etc.
Dropping down a row each time it finishes.
My range of data is ever changing in length but always the same number of columns (5) so A - E
The second set of data will start in K1 onwards and downwards.
Thanks in advance
VBA Code:
Sub Test2()
Dim x As Integer
Application.ScreenUpdating = False
Sheets("Sheet2").Select
NumRows = Range("A1", Range("A1").End(xlDown)).Rows.Count
Range("A2").Select
For x = 1 To NumRows
If Cells(i, 2).Value = "" Then
Next
ElseIf Cells(i, 2).Value = "<>""" Then
Cells(i, 2).Copy
Range("K1").PasteSpecial
End If
Next
Application.ScreenUpdating = True
End Sub