Hi, I need a code for a button so when I press it the time is shown in say
cell A1 and it will not change untill I press the button agian.
Thank's inadvance, Barry.
Hi, I need a code for a button so when I press it the time is shown in say
cell A1 and it will not change untill I press the button agian.
Thank's inadvance, Barry.
ActiveCell = Time 'Time only
ActiveCell = Date & " " & Time 'Date And Time
HTH
Die_Another_Day
wildauk wrote:
> Hi, I need a code for a button so when I press it the time is shown in say
> cell A1 and it will not change untill I press the button agian.
>
> Thank's inadvance, Barry.
Range("A1") = Time 'Time only
Range("A1") = Date & " " & Time 'Date And Time
HTH
Die_Another_Day
wildauk wrote:
> Hi, I need a code for a button so when I press it the time is shown in say
> cell A1 and it will not change untill I press the button agian.
>
> Thank's inadvance, Barry.
Try this...
public sub AddTimeStamp()
activesheet.range("A1").value = now()
end sub
--
HTH...
Jim Thomlinson
"wildauk" wrote:
> Hi, I need a code for a button so when I press it the time is shown in say
> cell A1 and it will not change untill I press the button agian.
>
> Thank's inadvance, Barry.
yes that worked thank you, is there any way I can only have the time without
the date?
"Die_Another_Day" wrote:
> Range("A1") = Time 'Time only
> Range("A1") = Date & " " & Time 'Date And Time
>
> HTH
>
>
> Die_Another_Day
>
> wildauk wrote:
> > Hi, I need a code for a button so when I press it the time is shown in say
> > cell A1 and it will not change untill I press the button agian.
> >
> > Thank's inadvance, Barry.
>
>
My preference is to always capture both date and time. If you want to you can
change the formatting of the cell to only display the time. If however later
on you decide that you want both then you do not need to change the code,
only to change the formatting of the cell. It gives you more flexibility to
change your mind...
--
HTH...
Jim Thomlinson
"wildauk" wrote:
> yes that worked thank you, is there any way I can only have the time without
> the date?
>
> "Die_Another_Day" wrote:
>
> > Range("A1") = Time 'Time only
> > Range("A1") = Date & " " & Time 'Date And Time
> >
> > HTH
> >
> >
> > Die_Another_Day
> >
> > wildauk wrote:
> > > Hi, I need a code for a button so when I press it the time is shown in say
> > > cell A1 and it will not change untill I press the button agian.
> > >
> > > Thank's inadvance, Barry.
> >
> >
See first line...
"Die_Another_Day" wrote:
Range("A1") = Time 'Time only
Die_Another_Day
wildauk wrote:
> yes that worked thank you, is there any way I can only have the time without
> the date?
>
> "Die_Another_Day" wrote:
>
> > Range("A1") = Time 'Time only
> > Range("A1") = Date & " " & Time 'Date And Time
> >
> > HTH
> >
> >
> > Die_Another_Day
> >
> > wildauk wrote:
> > > Hi, I need a code for a button so when I press it the time is shown in say
> > > cell A1 and it will not change untill I press the button agian.
> > >
> > > Thank's inadvance, Barry.
> >
> >
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks