Thread: Userform Label
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Kevin B Kevin B is offline
external usenet poster
 
Posts: 1,316
Default Userform Label

Got it.

Try this in the initialize event. I have a label named lblDate on the form
and it's assigned the current date.

Private Sub UserForm_Initialize()

Me.lblDate.Caption = Date

End Sub

or if you prefer the full date try this one

Private Sub UserForm_Initialize()

Me.lblDate.Caption = Format(Date, "dddd, mmmm d, yyyy")

End Sub

Hope that helps.
--
Kevin Backmann


"Steve" wrote:

On 29 Oct, 20:50, Kevin B wrote:
You can just place the following function in the cell:

=TODAY()

if you want to form to assign the value you can have the user form place the
date in the cell using the following code in the UserForm_Initialize event:

Private Sub UserForm_Initialize()

ThisWorkbook.Sheets(1).Range("A1").Formula = "=TODAY()"

End Sub

Change sheet name and range accordingly

--
Kevin Backmann



"Steve" wrote:
HYCH


Is there anyway I can link a userform label to a cell, i want the cell
to display the current date and change accordingly.


or is there another way to accomplish this ?


Steve- Hide quoted text -


- Show quoted text -


Sorry Kev,

did not make that as clear when i read it again, :(

Was looking for the Label to be updated on the userform with the date,

what i am looking for is a userform label to update itself
accordingly.

HYCH

Steve