Rickinnocal
New Member
- Joined
- Dec 14, 2010
- Messages
- 33
- Office Version
- 365
- Platform
- Windows
Hello, I have a command button on a worksheet that creates and populates a new workbook. The new workbook is required only for one specific client, so if the job is for a different client, I'd like the command button to be hidden.
The name of the client is in cell E5.
This is my code...
No error messages, but the button is always visible.
The name of the button is correctly spelled, as the sub
functions exactly as it should.
What am I doing wrong, please?
The name of the client is in cell E5.
This is my code...
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
If Cells(6, 5).Value = "CMA CGM" Then
Me.cmdCMAeFile.Visible = True
Else
Me.cmdCMAeFile.Visible = False
End If
Application.ScreenUpdating = True
End Sub
No error messages, but the button is always visible.
The name of the button is correctly spelled, as the sub
VBA Code:
Private Sub cmdCMAeFile_Click()
functions exactly as it should.
What am I doing wrong, please?