Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Values don't behave when converting text to values in userform

VBA / Xl 2002

I use a userform to make the user input in a time registration form. The
format on the userform form side is .text. When saving this information to a
different sheet I try to convert the text to values by changing the suffix
from .text to .value. When the values are printed on the sheet, the comma
(used as a delimiter in Danish language instead of "." ) has been deleted.

Using the following code:
Range(Cells(15, 6), Cells(31, 7)).Select
Selection.NumberFormat = "0,0"

and enter the value 1,23456 in the form, I get the output in the following
format
123.456

What can I do get the representation right? Thx in advance.


Private Sub GemClick_Click()
Dim i As Integer
Dim dato As Date

Worksheets("Timeseddel").Activate

Range(Cells(15, 3), Cells(31, 7)).ClearContents
Cells(7, 7).ClearContents
Range(Cells(15, 6), Cells(31, 7)).Select
Selection.NumberFormat = "0,0"
ActiveWorkbook.Save

Cells(15, 3).Activate

With ActiveCell

If ChkAltDato = True Then
..Offset(-8, 4).Value = TxtAltDato.Text
Else: .Offset(-8, 4).Value = txtDato.Text
End If

.Offset(0, 0).Value = LstNavn1.Text
.Offset(0, 1).Value = TxtWkType1.Text
.Offset(0, 2).Value = TextRmk1.Text
.Offset(0, 3).Value = TextTimeDbt1.Value
.Offset(0, 4).Value = TextTimeNonDbt1.Value

.....

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Values don't behave when converting text to values in userform

Have you tried
Offset().Text=
instead of
Offset().Value=
--
Gary's Student
gsnu200706


"Kragelund" wrote:

VBA / Xl 2002

I use a userform to make the user input in a time registration form. The
format on the userform form side is .text. When saving this information to a
different sheet I try to convert the text to values by changing the suffix
from .text to .value. When the values are printed on the sheet, the comma
(used as a delimiter in Danish language instead of "." ) has been deleted.

Using the following code:
Range(Cells(15, 6), Cells(31, 7)).Select
Selection.NumberFormat = "0,0"

and enter the value 1,23456 in the form, I get the output in the following
format
123.456

What can I do get the representation right? Thx in advance.


Private Sub GemClick_Click()
Dim i As Integer
Dim dato As Date

Worksheets("Timeseddel").Activate

Range(Cells(15, 3), Cells(31, 7)).ClearContents
Cells(7, 7).ClearContents
Range(Cells(15, 6), Cells(31, 7)).Select
Selection.NumberFormat = "0,0"
ActiveWorkbook.Save

Cells(15, 3).Activate

With ActiveCell

If ChkAltDato = True Then
.Offset(-8, 4).Value = TxtAltDato.Text
Else: .Offset(-8, 4).Value = txtDato.Text
End If

.Offset(0, 0).Value = LstNavn1.Text
.Offset(0, 1).Value = TxtWkType1.Text
.Offset(0, 2).Value = TextRmk1.Text
.Offset(0, 3).Value = TextTimeDbt1.Value
.Offset(0, 4).Value = TextTimeNonDbt1.Value

....

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Values don't behave when converting text to values in userform

Yes, I did that at first. The result is that the number is formatted as text,
which means that I can sum up the rows in the destination sheet. That was the
first problem I was trying to get around by renaming the offset .value
instead of .text, but apparently with little succes.




"Gary''s Student" skrev:

Have you tried
Offset().Text=
instead of
Offset().Value=
--
Gary's Student
gsnu200706


"Kragelund" wrote:

VBA / Xl 2002

I use a userform to make the user input in a time registration form. The
format on the userform form side is .text. When saving this information to a
different sheet I try to convert the text to values by changing the suffix
from .text to .value. When the values are printed on the sheet, the comma
(used as a delimiter in Danish language instead of "." ) has been deleted.

Using the following code:
Range(Cells(15, 6), Cells(31, 7)).Select
Selection.NumberFormat = "0,0"

and enter the value 1,23456 in the form, I get the output in the following
format
123.456

What can I do get the representation right? Thx in advance.


Private Sub GemClick_Click()
Dim i As Integer
Dim dato As Date

Worksheets("Timeseddel").Activate

Range(Cells(15, 3), Cells(31, 7)).ClearContents
Cells(7, 7).ClearContents
Range(Cells(15, 6), Cells(31, 7)).Select
Selection.NumberFormat = "0,0"
ActiveWorkbook.Save

Cells(15, 3).Activate

With ActiveCell

If ChkAltDato = True Then
.Offset(-8, 4).Value = TxtAltDato.Text
Else: .Offset(-8, 4).Value = txtDato.Text
End If

.Offset(0, 0).Value = LstNavn1.Text
.Offset(0, 1).Value = TxtWkType1.Text
.Offset(0, 2).Value = TextRmk1.Text
.Offset(0, 3).Value = TextTimeDbt1.Value
.Offset(0, 4).Value = TextTimeNonDbt1.Value

....

End Sub

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
Converting Text into Values Terry Bennett Excel Worksheet Functions 6 August 27th 09 02:03 AM
Converting values to text Keith Rathband New Users to Excel 3 October 4th 08 11:18 PM
Converting Text to Values JEFF Excel Programming 2 August 3rd 05 03:10 PM
vba is converting text to values! Bill_S Excel Programming 2 April 26th 05 03:52 AM
Can we make a cell behave like a list box and populate it with values for selection. Prasad Vanka Excel Programming 0 June 9th 04 05:57 PM


All times are GMT +1. The time now is 02:56 AM.

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"