K
Kragelund
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
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