ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   JLatham 2-timing on T.Valko now are we? :) (https://www.excelbanter.com/excel-discussion-misc-queries/214064-jlatham-re-2-timing-t-valko-now-we.html)

aussiegirlone

JLatham 2-timing on T.Valko now are we? :)
 
Thats two days in a row you put a smile on my face JLatham
If you keep this up you might become the Sweetheart of the month. Attracting
the female audience is always good. aussiegirlone :)
On asking Question:
I had made an error in my question as I meant to say €śchange the days not
Date €ś

You wrote:
€śWhat do you mean by "named" - do you mean you actually named it that or that
Sunday is what appears on the button. Also, where did you get the button
from: the Forms menu tools or the Controls Toolbox menu?€ť
My Answers.
Sunday is what appears on the button and the controls toolbox is what I am
using. (Is there a difference between the forms menu tools or controls
toolbox?) If yes please explain. This is the code I used for the command
button.

Private Sub CommandButton1_Click()
Worksheets("IncidentDesription").Select
Application.Goto Worksheets("IncidentDesription").Range("A1"), Scroll:=True
'or false??
End Sub

To explain what I have done to my work book (PS: if you need a copy ask
T.Valko.) In sheet named (Incident report) I created a command button. Which
will on click goto a sheet named IncidentDescription. On sheet3 B13-H13 are
the Weekdays which when I decide to change the day from Sunday to any other
day of the week, all sheets will change automatically accept my command
buttons name (Sunday.) Sheet3 is where all changes will be made and all other
sheets will be (eventually) locked so no changes can be made to them
I am a self learner in which I get nervous to do things, concerned that I
would stuff up.

(I see the code dave Peterson wrote for me, that (mmmm dd yyyy) is the date.
Is this still ok to use or does it need to be changed?)
Dave Peterson wrote:
You can use a worksheet event under the worksheet that contains the cell.

Rightclick on the worksheet tab with the changing cell. Select view code.
Paste this into the newly opened code window:

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

You'll have to change the cell to look at (I used A1). As well as the other
worksheet's name, the commandbutton's name and use the caption you want.



All times are GMT +1. The time now is 07:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com