Values don't behave when converting text to values in userform

G

Guest

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
 
G

Guest

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:
 

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

Top