Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 94
Default Command Buttons

I have a command button's name (sunday) to change automatically when I change
the day on a different worksheet. I have since added six more command buttons
(one for each day of the week), however I do not know how to edit this code
below to include all the other command buttons. Any help would be appreciated
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myCell As Range
Set myCell = Me.Range("A1")

If Target.Cells.Count 1 Then
Exit Sub 'one cell at a time
End If

If Intersect(Target, myCell) Is Nothing Then
Exit Sub
End If

Worksheets("sheet1").CommandButton1.Caption _
= Format(myCell.Value, "mmmm dd, yyyy")

End Sub

 
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
Command buttons aussiegirlone Excel Discussion (Misc queries) 2 January 8th 09 09:09 AM
Command Buttons Hoyas07 Excel Discussion (Misc queries) 2 February 11th 08 03:42 PM
Command Buttons msals22 Excel Discussion (Misc queries) 1 June 22nd 06 01:33 AM
Help with command buttons Danno Excel Worksheet Functions 1 October 7th 05 10:32 PM
command buttons Natalie Excel Worksheet Functions 1 March 7th 05 01:45 PM


All times are GMT +1. The time now is 08:33 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"