Displaying time as 1:00PM (etc) for a Label Value?

TAPS_MikeDion

Well-known Member
Joined
Aug 14, 2009
Messages
622
Office Version
  1. 2011
Platform
  1. MacOS
Hi guys,

Using the code below works perfectly for displaying the time how I need it to be displayed in my Listbox, but how can this be converted to be displayed in the same way as a label value?

Code:
AddItem "Sunday"
   .List(0, 1) = Format(ws.Cells(SelectedRow, 41).Value, "h:mm AM/PM") 'Sunday Start Time
   .List(0, 2) = Format(ws.Cells(SelectedRow, 42).Value, "h:mm AM/PM") 'Sunday Finish Time

I tried just simply using: Me.SunStart.Value = Format(ws.Cells(SelectedRow, 41).Value, "h:mm AM/PM"), but that was a no-go.

Thank you for any help given.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Change .Value to .Caption
 
Upvote 0
I tried just simply using: Me.SunStart.Value = Format(ws.Cells(SelectedRow, 41).Value, "h:mm AM/PM"), but that was a no-go.
In what way was it a "no-go"? Please describe happened...

Did you get an error? If so, what was it?

If not, what actually happened and what were you expecting to happen?

What was in the cell at the time of the "no-go"?
 
Upvote 0
Hi Rick,

I just went to go through it again so I could answer all of your questions, and for whatever reason...It worked using what I tried before (what you have in your quote from me) that didn't work.

:laugh:

Everything is all set. Thanks anyway!
 
Upvote 0
Glad it's working & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,264
Members
452,627
Latest member
KitkatToby

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top