Hi guys -
2 VB items I'm hoping someone could at look at and tell me what I'm doing wrong:
Item #1 - I'm trying to have a macro fire only when a command button is pressed. The current code works when the button is pressed, but it also fires when I open the book and I don't need it to fire upon opening.
Private Sub CommandButton1_Click()
If CommandButton1.Caption = "Update Monthly Returns" Then
Run "PullInReturns()"
End If
End Sub
Item #2 - I'm trying to get part of the code below to also paste formats ? Any suggestions on the code to include ?
On Error Resume Next
.SpecialCells(xlCellTypeFormulas, xlErrors).Clear
On Error GoTo 0
'Change all formulas to Values only
.Value = .Value
End With
Thanks,
Mark
2 VB items I'm hoping someone could at look at and tell me what I'm doing wrong:
Item #1 - I'm trying to have a macro fire only when a command button is pressed. The current code works when the button is pressed, but it also fires when I open the book and I don't need it to fire upon opening.
Private Sub CommandButton1_Click()
If CommandButton1.Caption = "Update Monthly Returns" Then
Run "PullInReturns()"
End If
End Sub
Item #2 - I'm trying to get part of the code below to also paste formats ? Any suggestions on the code to include ?
On Error Resume Next
.SpecialCells(xlCellTypeFormulas, xlErrors).Clear
On Error GoTo 0
'Change all formulas to Values only
.Value = .Value
End With
Thanks,
Mark