Copying non blank cells from one sheet to another
Closed
JohnMcLaughlin
Posts
10
Registration date
Sunday 8 April 2018
Status
Member
Last seen
19 April 2018
-
19 Apr 2018 à 08:47
JohnMcLaughlin Posts 10 Registration date Sunday 8 April 2018 Status Member Last seen 19 April 2018 - 19 Apr 2018 à 13:07
JohnMcLaughlin Posts 10 Registration date Sunday 8 April 2018 Status Member Last seen 19 April 2018 - 19 Apr 2018 à 13:07
Related:
- Atonemeaning
- How to copy data from one excel sheet to another - Guide
- How to copy data to multiple worksheets in Excel - Guide
- How to transfer data from one Excel sheet to another? - Guide
- Excel link to another sheet - Guide
- Little alchemy cheat sheet - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday 12 September 2010
Status
Contributor
Last seen
27 December 2022
555
19 Apr 2018 à 11:04
19 Apr 2018 à 11:04
Hi John,
How about this code:
Best regards,
Trowa
How about this code:
Sub RunMe()
Dim nRow, nCol, x As Integer
nRow = 2
nCol = 3
Sheets("Sheet1").Select
Do
If nCol = 17 Then
nRow = nRow + 1
nCol = 3
x = 0
End If
If Cells(nRow, nCol).Value <> vbNullString Then
Cells(nRow, nCol).Copy Sheets("Sheet2").Range("C" & Rows.Count).End(xlUp).Offset(1, 0)
Else
x = x + 1
End If
nCol = nCol + 1
Loop Until x = 14
End Sub
Best regards,
Trowa
19 Apr 2018 à 13:07