Frankietheflyer
New Member
- Joined
- Nov 17, 2017
- Messages
- 30
Hi
The Code below looks at a dynamic list of information in a worksheet "Teams & Runners Data Form Entry" and should copy all the information in Columns B:E and paste it into the sheet "Team List" columns A:D.
However! It currently only copies 10 of the 18 rows in the "Teams & Runners Data Form Entry" sheet (11 counting the header). Column B in the "Teams & Runners Data Form Entry" sheet is full with no blanks although columns D and E do have some blank cells in them but never in both together on the same row.
I've run a "=COUNTA(B:B)" in the "Teams & Runners Data Form Entry" sheet and it comes up with a count of 18.
An ideas why the code is not copying the last few rows please?
<strike>
</strike>
Thanks
Frankie
The Code below looks at a dynamic list of information in a worksheet "Teams & Runners Data Form Entry" and should copy all the information in Columns B:E and paste it into the sheet "Team List" columns A:D.
However! It currently only copies 10 of the 18 rows in the "Teams & Runners Data Form Entry" sheet (11 counting the header). Column B in the "Teams & Runners Data Form Entry" sheet is full with no blanks although columns D and E do have some blank cells in them but never in both together on the same row.
I've run a "=COUNTA(B:B)" in the "Teams & Runners Data Form Entry" sheet and it comes up with a count of 18.
An ideas why the code is not copying the last few rows please?
<strike>
</strike>
Code:
[FONT=Verdana]Sub LoadTeamList()[/FONT]
[FONT=Verdana]Application.ScreenUpdating = False[/FONT]
[FONT=Verdana]Dim wb As Workbook
Dim Found As Range[/FONT]
[FONT=Verdana]With Sheets("Team List")[/FONT]
[FONT=Verdana].Range("A:D").ClearContents[/FONT]
[FONT=Verdana] Set destRng = .Range("A" & .Cells(.Rows.Count, "A").End(xlUp).Row)
LastRow = Sheets("Teams & Runners Data Form Entry").Range("B1:B" & Rows.Count).End(xlUp).Row
Sheets("Teams & Runners Data Form Entry").Range("B1:E1" & LastRow).Copy Destination:=destRng
.Columns("A:D").AutoFit
Application.ScreenUpdating = True
End With[/FONT]
[FONT=Verdana]End Sub
[/FONT]
Thanks
Frankie
Last edited: