#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default Hiding Buttons

Hi all,

HYCH with this

I have 7 buttons on a page but would like 1 to be displayed depending
on a given criteria, ie day of the week.
I was hoping the simple code below would work, but appears not.
Any helps please??


Private Sub Workbook_Open()
Worksheets("Sheet1").Activate
With ActiveWindow
Application.Command("button 6").Visible = False
End With
If Weekday(Worksheets("sheet1").Range("g1").Value) = vbWednesday
Then
TextBox1_Click.Show
Else
somefrm.Show
End If
End Sub


Steve

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default Hiding Buttons

On 26 Sep, 11:03, K1KKKA wrote:
Hi all,

HYCH with this

I have 7 buttons on a page but would like 1 to be displayed depending
on a given criteria, ie day of the week.
I was hoping the simple code below would work, but appears not.
Any helps please??

Private Sub Workbook_Open()
Worksheets("Sheet1").Activate
With ActiveWindow
Application.Command("button 6").Visible = False
End With
If Weekday(Worksheets("sheet1").Range("g1").Value) = vbWednesday
Then
TextBox1_Click.Show
Else
somefrm.Show
End If
End Sub

Steve



For information purposes,

This works fine :)



Private Sub Workbook_Open()
Worksheets("Sheet1").Activate
ActiveSheet.Shapes("Btn1").Visible = False
ActiveSheet.Shapes("Btn2").Visible = False
ActiveSheet.Shapes("Btn3").Visible = False
If Weekday(Worksheets("sheet1").Range("g1").Value) = vbWednesday
Then
ActiveSheet.Shapes("Btn").Visible = True
Else
If Weekday(Worksheets("sheet1").Range("g1").Value) = vbThursday
Then
ActiveSheet.Shapes("Btn2").Visible = True
Else
If Weekday(Worksheets("sheet1").Range("g1").Value) = vbFriday Then
ActiveSheet.Shapes("Btn3").Visible = True
End If
End If
End If
End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Form buttons vs. ActiveX Buttons GeorgeJ Excel Discussion (Misc queries) 3 August 11th 07 09:02 PM
have toggle buttons but everytime print preview buttons move TinSandhu Excel Discussion (Misc queries) 1 October 11th 06 02:57 PM
Hiding a button when hiding rows fergusor Excel Discussion (Misc queries) 2 August 10th 06 02:31 PM
Collapsing/Hiding radio and macro buttons Lance Gray Excel Discussion (Misc queries) 1 December 20th 05 04:50 PM
hiding/unhiding rows & columns with "+" and "-" buttons shellshock Excel Discussion (Misc queries) 2 August 3rd 05 05:22 AM


All times are GMT +1. The time now is 02:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"