pinkpanther6666
Board Regular
- Joined
- Feb 13, 2008
- Messages
- 194
- Office Version
- 365
- Platform
- Windows
Hi All,
I am having a problem with the code below, when its run it comes up with error code " Runtime error Code 13" and Type Mismatch, i have looked at the code for a couple of hours or so and i cant see the blatenly obvious. Could someone else have a look and let me know what i have done wrong
Sub InsertData()
Sheets("PSForm").Select
If Range("N5") = "AA" Or "BB" Or "CC" Or "DD" or "End" Then GoTo Line1 Else GoTo Line2
Line1:
If Range("N5").Value = "AA" Then
Sheets("Fixtures").Select
Range("A2:B23").Copy
Sheets("PSForm").Select
Range("V13").Select
ActiveSheet.Paste
ElseIf Range("N5").Value = "BB" Then
Sheets("Fixtures").Select
Range("D2:E23").Copy
Sheets("PSForm").Select
Range("V13").Select
ActiveSheet.Paste
ElseIf Range("N5").Value = "CC" Then
Sheets("Fixtures").Select
Range("G2:H23").Copy
Sheets("PSForm").Select
Range("V13").Select
ActiveSheet.Paste
ElseIf Range("N5").Value = "DD" Then
Sheets("Fixtures").Select
Range("J2:K23").Copy
Sheets("PSForm").Select
Range("V13").Select
ActiveSheet.Paste
ElseIf Range("N5").Value = "End" Then GoTo Line2
Sheets("Fixtures").Select
Range("U1").Copy
Sheets("PSForm").Select
Range("V13:W34").Select
ActiveSheet.Paste
End If
Line2:
Calculate
End Sub
Many Thanks
Steve
I am having a problem with the code below, when its run it comes up with error code " Runtime error Code 13" and Type Mismatch, i have looked at the code for a couple of hours or so and i cant see the blatenly obvious. Could someone else have a look and let me know what i have done wrong
Sub InsertData()
Sheets("PSForm").Select
If Range("N5") = "AA" Or "BB" Or "CC" Or "DD" or "End" Then GoTo Line1 Else GoTo Line2
Line1:
If Range("N5").Value = "AA" Then
Sheets("Fixtures").Select
Range("A2:B23").Copy
Sheets("PSForm").Select
Range("V13").Select
ActiveSheet.Paste
ElseIf Range("N5").Value = "BB" Then
Sheets("Fixtures").Select
Range("D2:E23").Copy
Sheets("PSForm").Select
Range("V13").Select
ActiveSheet.Paste
ElseIf Range("N5").Value = "CC" Then
Sheets("Fixtures").Select
Range("G2:H23").Copy
Sheets("PSForm").Select
Range("V13").Select
ActiveSheet.Paste
ElseIf Range("N5").Value = "DD" Then
Sheets("Fixtures").Select
Range("J2:K23").Copy
Sheets("PSForm").Select
Range("V13").Select
ActiveSheet.Paste
ElseIf Range("N5").Value = "End" Then GoTo Line2
Sheets("Fixtures").Select
Range("U1").Copy
Sheets("PSForm").Select
Range("V13:W34").Select
ActiveSheet.Paste
End If
Line2:
Calculate
End Sub
Many Thanks
Steve