LadyWraith
Board Regular
- Joined
- Aug 1, 2014
- Messages
- 50
I inserted a command button into an existing excel spreadsheet. I went in vb editor for the button to write the code for the button's function. However, when you click the button, nothing happens. I think I forget/missed the line to make it do the macro. Does anyone see what I missed?
Option Explicit
Sub Button1_Click()
Dim i As Long
Dim sh As Object
Dim Yr, Yr_P, Yr_F, Q, Q_P, Q_F
Dim Qinput, TabName As String
Qinput = InputBox(Prompt:="Enter the year you want to create new slides for")
If Qinput = vbNullString Then
Exit Sub
Else
End If
Yr = Right(Left(Qinput, 4), 2)
Q = Right(Left(Cells(2, "F").Value, 2), 1)
Option Explicit
Sub Button1_Click()
Dim i As Long
Dim sh As Object
Dim Yr, Yr_P, Yr_F, Q, Q_P, Q_F
Dim Qinput, TabName As String
Qinput = InputBox(Prompt:="Enter the year you want to create new slides for")
If Qinput = vbNullString Then
Exit Sub
Else
End If
Yr = Right(Left(Qinput, 4), 2)
Q = Right(Left(Cells(2, "F").Value, 2), 1)