0

I am trying to find a football team name in a list of results on Sheet 2017 - 2018 Brazil Serie A which is fine that works ok when found, I want the cells next to the name and the next 5 to copy and paste to another sheet AFC Bournemouth what I get is the copying AFC Bournemouth b16:f16 can someone tell me what I'm doing wrong please

Sub finddataTeamTimeGoals()
Application.ScreenUpdating = False

Dim findhometeam As String
Dim findawayteam As String
Dim finalrow As Integer
Dim i As Integer

Dim totalmatches As Long

Sheets("AFC Bournemouth").Range("a2:ab50").ClearContents

findhometeam = Sheets("2017-2018 Brazil Serie A").Range("i2").Value
finalrow = Sheets("2017-2018 Brazil Serie A").Cells(Rows.Count, 4).End(xlUp).Row
totalmatches = Sheets("2017-2018 Brazil Serie A").Cells(Rows.Count, 4).End(xlUp).Row
finalrow1 = Sheets("2017-2018 Brazil Serie A").Cells(Rows.Count, 31).End(xlUp).Row

For i = 2 To finalrow

    Sheets("2017-2018 Brazil Serie A").Activate
    If Sheets("2017-2018 Brazil Serie A").Cells(i, 1) = findhometeam Then
        Range(Cells(i, 2), Cells(i, 6)).Copy
        Sheets("AFC Bournemouth").Activate
        Range("b12").End(xlUp).Offset(1, 0).PasteSpecial xlPasteFormulasAndNumberFormats
        Sheets("2017-2018 Brazil Serie A").Activate
        End If
Next i

End Sub
Ltr
  • 1
  • 2
  • ok thank you guess that's the end of the help then still don't get how it works – Ltr Aug 28 '17 at 18:12
  • Yes been searching all day can find everything on copying to same sheet using a loop and copying one cell to a different sheet but not what I need and no one wants to explain how it works I don't even want the code just to explain then I can write my own don't worry will sort something out – Ltr Aug 28 '17 at 18:47
  • https://stackoverflow.com/questions/1599715/excel-copy-worksheet – Graham Aug 28 '17 at 18:58
  • https://stackoverflow.com/questions/45486514/excel-copy-cell – Graham Aug 28 '17 at 18:58
  • Have you tried a VBA tutorial first? Copying cell values is usually one of the first topics you learn when you start with VBA. – Graham Aug 28 '17 at 18:59
  • Yes just cant get a loop to copy multiple results into another sheet – Ltr Aug 28 '17 at 19:41

0 Answers0