VBA time display in a Textbox

Sinbad

Board Regular
Joined
Apr 18, 2012
Messages
224
Hi All,

need some help jet again.

I have a bit of code that fills textfields etc in a Userform. The data is being pulled from the spreadsheet but in this case the TIME is displayed weirdly.

It shows as 0,46875 and should show 11:15:00 as in the spreadsheet. any suggestions on what I´m doing wrong ?

the line that reads this value is

Code:
.STime.Value = Cells(ActiveCell.Row, "V").Value

help as always most appreciated.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hi

You just need to format it:

Code:
.STime.Value = Format(Cells(ActiveCell.Row, "V").Value,"hh:mm:ss")
 
Upvote 0
Anz ideas whz on Win 8 with Office 2010 it gives me this error _ on Win 7 with Office 2010 it works fine ..

2013-03-23%2001-58-13%20PM.png


It stops and highlight the word Format int he given code.

Code:
.STime.Value = [B]Format[/B](Cells(ActiveCell.Row, "V").Value,"hh:mm:ss")
 
Upvote 0
In the VBE look in Tools>References (in the menu bar) and uncheck any that are listed as MISSING.

If this doesn't work, can you tell me what the error is (I couldn't see the image)
 
Upvote 0
OK it's definitely a References problem - you need to make sure whatever references you have checked in the list in the Windows7 one are also checked in the Windows 8 one too
 
Upvote 0
Found it. It is the datepicker control that is not available. Brings me to the next question. how do I get it back. I would like the user to be able to select a date from the pop/up calendar. Any suggestions
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,497
Members
448,967
Latest member
visheshkotha

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