Userform Initialization

P

Patrick Simonds

I use the following code to enter data in a Userform, if the data already
exists on the spreadsheet. Everything works great, unless the time is 12:00
(using 24 hour time) then it displays on the Userform as 00:05, even though
it is displayed correctly on the spreadsheet.


'Places data in the userform text boxes if it exists on the spreadsheet

TextBox1.Text = rng(1, 47).Value
TextBox1.Text = Format(TextBox1.Text, "hh:mm")
TextBox2.Text = rng(1, 48).Value
TextBox2.Text = Format(TextBox2.Text, "hh:mm")
 
B

Bob Phillips

Patrick,

Try this

TextBox1.Text = Format(rng(1,47).Value, "hh:mm")
TextBox2.Text = Format(rng(1,48.Value, "hh:mm")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top