Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 275
Default Format problem in displayed userform

Hi all,

In sheet 'DATA' cells B12 and I12 are the source data
these are copy/pasted into cells B2 and I12 of 'RESULTS' sheet
all of these cells are formatted as 'Custom hh:mm' however when I place
these values into my userform they are with no format ie 0.42342423154238

Any ideas as to why??

many thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default Format problem in displayed userform

0.42342423154238 stands for 10:09:44

you should (re)format yr values put into userform

with .NumberFormat = "h:mm:ss" for instance
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 275
Default Format problem in displayed userform

Hi Jarek and thanks for ur reply,

the code in my userform is as follows...

ws.Cells(iRow, 2).Value = Me.txtTime.Value

how do I reformat this so that is is correctly formatted as HH:MM?

"Jarek Kujawa" wrote:

0.42342423154238 stands for 10:09:44

you should (re)format yr values put into userform

with .NumberFormat = "h:mm:ss" for instance

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default Format problem in displayed userform

am not sure but you might try Me.txtTime

or use sth. like

ws.Cells(iRow, 2).Value =
Application.WorksheetFunction.Text(Me.txtTime,"hh: mm")
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Format problem in displayed userform

with ws.cells(irow,2)
.numberformat = "h:mm:ss"
.value = me.txttime.value
end with



Anthony wrote:

Hi Jarek and thanks for ur reply,

the code in my userform is as follows...

ws.Cells(iRow, 2).Value = Me.txtTime.Value

how do I reformat this so that is is correctly formatted as HH:MM?

"Jarek Kujawa" wrote:

0.42342423154238 stands for 10:09:44

you should (re)format yr values put into userform

with .NumberFormat = "h:mm:ss" for instance


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 275
Default Format problem in displayed userform

Hi Dave,

Sorry I think I placed the wrong part of the code..

it should have been

frmOldJob.Label18 = Range("B2")

So how do I get this formatted as hh:mm??

"Dave Peterson" wrote:

with ws.cells(irow,2)
.numberformat = "h:mm:ss"
.value = me.txttime.value
end with



Anthony wrote:

Hi Jarek and thanks for ur reply,

the code in my userform is as follows...

ws.Cells(iRow, 2).Value = Me.txtTime.Value

how do I reformat this so that is is correctly formatted as HH:MM?

"Jarek Kujawa" wrote:

0.42342423154238 stands for 10:09:44

you should (re)format yr values put into userform

with .NumberFormat = "h:mm:ss" for instance


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default Format problem in displayed userform

why not:

frmOldJob.Label18.Caption =
Application.WorksheetFunction.Text((Range("B2"), "hh:mm:ss")


HIH
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 275
Default Format problem in displayed userform

Hi Jarek,

A slight typo but your suggestion works just great...

Application.WorksheetFunction.Text((Range("B2")), "hh:mm:ss")

Many thanks
"Jarek Kujawa" wrote:

why not:

frmOldJob.Label18.Caption =
Application.WorksheetFunction.Text((Range("B2"), "hh:mm:ss")


HIH

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Format problem in displayed userform

If B2 is already formatted nicely:
frmOldJob.Label18 = Range("B2").Text

or use VBA's own format function:
frmOldJob.Label18 = format(Range("B2").value, "h:mm:ss")



Anthony wrote:

Hi Dave,

Sorry I think I placed the wrong part of the code..

it should have been

frmOldJob.Label18 = Range("B2")

So how do I get this formatted as hh:mm??

"Dave Peterson" wrote:

with ws.cells(irow,2)
.numberformat = "h:mm:ss"
.value = me.txttime.value
end with



Anthony wrote:

Hi Jarek and thanks for ur reply,

the code in my userform is as follows...

ws.Cells(iRow, 2).Value = Me.txtTime.Value

how do I reformat this so that is is correctly formatted as HH:MM?

"Jarek Kujawa" wrote:

0.42342423154238 stands for 10:09:44

you should (re)format yr values put into userform

with .NumberFormat = "h:mm:ss" for instance


--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Userform problem? law Excel Discussion (Misc queries) 0 December 3rd 07 07:54 PM
userform problem TUNGANA KURMA RAJU Excel Discussion (Misc queries) 0 August 10th 06 04:43 AM
Userform problem (Listindex) jgmiddel Excel Discussion (Misc queries) 1 April 26th 06 01:34 PM
printen userform problem Pierre via OfficeKB.com Excel Worksheet Functions 0 January 3rd 06 04:45 PM
UserForm Recall Problem Andy Tallent Excel Discussion (Misc queries) 1 April 15th 05 06:14 PM


All times are GMT +1. The time now is 06:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"