ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,832
- Office Version
- 2007
- Platform
- Windows
This code shown below will hides shapes etc on the worksheet.
Ive since added CheckBox1 & CheckBox2 & would like them to be shown on the page.
See screenshot of current page where they should be shown.
Please advise how i alter the code to see the 2 Checkboxes.
I did add this but made no difference & was still hidden
VBA Code:
Sub HideButtons()
On Error GoTo ErrHand:
Call TurnOffFeatures ' Stop events etc...
' Define the original sheet
Dim wks As Worksheet
Set wks = Worksheets("INV")
' Define the copied sheet
If wks.Range("G13").Value <> "" Then ' if name
wks.Copy After:=Worksheets(Sheets.count) ' Copy to last sheets
Worksheets(Sheets.count).NAME = wks.Range("G13").Value ' rename sheet
Dim wksNew As Worksheet
Set wksNew = Worksheets(wks.Range("G13").Value) ' set wksNew as new sheet (Selected by name: I would recommend using this)
End If
' Hide all others CommanButtons except "PrintGeneratedSheet"
Dim Shape As Shape
For Each Shape In wksNew.Shapes
If Shape.NAME <> "PrintGeneratedSheet" Then
Shape.Visible = False
End If
Next
ErrHand:
Call TurnOnFeatures ' Enable events etc...
End Sub
Ive since added CheckBox1 & CheckBox2 & would like them to be shown on the page.
See screenshot of current page where they should be shown.
Please advise how i alter the code to see the 2 Checkboxes.
I did add this but made no difference & was still hidden
VBA Code:
If Shape.NAME <> "CheckBox1" Then
Shape.Visible = True
End If