title: Excel 2013 VBA Creating Buttons for a New Workbook
body: <p>Long time user, first time poster!</p>
  
  <p>I work at a Campus Food Shelf and I've recently become very involved in streamlining their reporting and data entry. The task I'm currently preforming is making a program that would create a uniformed sheet 1, so that the reporting programs I've built thus far can be easily exported to new workbooks, long after I graduate. I'm familiar (but by no means an expert) with C/C++, Python, and most recently VBA.</p>
  
  <p>I'm running into an error when creating buttons for Sheet 1. The error is: "Identifier under cursor is not recognized". The result I'm looking for with this code is to create 5 separate buttons linked to 5 separate Sub programs that have already been defined. I would like to place them at specific places with specific sizes. The code in question is:</p>
  
  <pre><code>Sub DONOTUSEbuttonMaker()
  Dim Report1, Report2, Report3, Unique, NewWork As Object
  
  Dim Targeter As Range
  Dim i As Integer
  
  For i = 1 To 5
    Select Case i:
      Case 1:
          Set Targeter = Worksheets(1).Range(Cells(3, 7), Cells(3, 7))
          Set Report1 = Worksheets(1).Buttons.Add(Targeter.Left, Targeter.Top, Width:=2, Height:=0.33)
          With Report1
              .OnAction = "WeeklyReportsP1"
              .Caption = "Weekly Reports P1"
              .Name = "Weekly Reports P1"
          End With
      Case 2:
          Set Targeter = Worksheets(1).Range(Cells(5, 7), Cells(5, 7))
          Set Report1 = Worksheets(1).Buttons.Add(Targeter.Left, Targeter.Top, Width:=2, Height:=0.33)
          With Report2
              .OnAction = "WeeklyReportsP2"
              .Caption = "Weekly Reports P2"
              .Name = "Weekly Reports P2"
          End With
      Case 3:
          Set Targeter = Worksheets(1).Range(Cells(7, 7), Cells(7, 7))
          Set Report1 = Worksheets(1).Buttons.Add(Targeter.Left, Targeter.Top, Width:=2, Height:=0.33)
          With Report3
              .OnAction = "WeeklyReportsP3"
              .Caption = "Weekly Reports P3"
              .Name = "Weekly Reports P3"
          End With
      Case 4:
          Set Targeter = Worksheets(1).Range(Cells(9, 7), Cells(9, 7))
          Set Report1 = Worksheets(1).Buttons.Add(Targeter.Left, Targeter.Top, Width:=2, Height:=0.33)
          With Unique
              .OnAction = "CalculateUnique"
              .Caption = "Calculate Unique"
              .Name = "Calculate Unique"
          End With
      Case 5:
          Set Targeter = Worksheets(1).Range(Cells(11, 7), Cells(11, 7))
          Set Report1 = Worksheets(1).Buttons.Add(Targeter.Left, Targeter.Top, Width:=2, Height:=0.33)
          With NewWork
              .OnAction = "NewWeekWorkSheet"
              .Caption = "Create New Worksheet"
              .Name = "Create New Worksheet"
          End With
  End Select
  Next i
  
  
  End Sub
  </code></pre>
  
  <p>The error generates in Case 2 at the line with .OnAction. Which also seems odd to me, because it doesn't throw an error in Case 1... Any help would be greatly appreciated!</p>