realhiphop
New Member
I'm creating a dashboard similar to the FIFA dashboard on this website. I have a list of teams and images. I'm getting a compile error. I changed some of the names from the FIFA code, but double checked the references and can't figure out what's wrong.
The error seems to be on the Team.Name line. Not sure why.
Thanks in advance!
Code:
OptionExplicit
Sub Teamdrop()
Dim Pic_sheet As Worksheet
Dim Dash_sheet As Worksheet
Dim imgLogo As Shape
Dim nameLogo AsString
Application.ScreenUpdating = False
Application.EnableEvents = False
Set Pic_sheet = ThisWorkbook.Worksheets(Team.Name)
Set Dash_sheet = ThisWorkbook.Worksheets(Dashboard.Name)
Dash_sheet.Activate
nameFlag = Range("TeamShort").Value
'Select the logo
For Each imgLogo In Dashboard.Shapes
If imgLogo.Name = nameLogo Then
ActiveSheet.Shapes.Range(Array(nameLogo)).Delete
Exit For
End If
Next
Pic_sheet.Activate
Pic_sheet.Shapes(nameLogo).Copy
'Paste the logo with name as in "Logo" cell
Dash_sheet.Activate
Range("LogoPos").Select
ActiveSheet.Paste
ActiveSheet.Shapes.Range(Array(nameLogo)).Select
'Position the logo in center of cell
Selection.ShapeRange.IncrementLeft 12
Selection.ShapeRange.IncrementTop 4.5
Application.ScreenUpdating = True
Application.EnableEvents = True
Range("B4").Select
EndSub
The error seems to be on the Team.Name line. Not sure why.
Thanks in advance!