I have a userform that has various codes that are beingmistaken by excel as date format or something and it keeps changing my formatautomatically.
The few of the code types are below.
1
2
3-5
3-17
3-23
3-61
7-81
7-86
How can I get these to stop changing when the userform macroexecutes and places the data in the cell?
Below is what I am using in the userform to input this data.
And then the button that executes the button
Open to any and all ideas.
Thanks in advance.
The few of the code types are below.
1
2
3-5
3-17
3-23
3-61
7-81
7-86
How can I get these to stop changing when the userform macroexecutes and places the data in the cell?
Below is what I am using in the userform to input this data.
Code:
[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]Public TypeHrRNG As Range[/COLOR][/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3][COLOR=#000000][FONT=Calibri][SIZE=3][COLOR=#000000]
Private Sub UserForm_Activate()[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3][COLOR=#000000][FONT=Calibri][SIZE=3][COLOR=#000000]
Set TypeHrRNG =Cells(ActiveCell.Row, "I")[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3][COLOR=#000000][FONT=Calibri][SIZE=3][COLOR=#000000][FONT=Times New Roman][SIZE=3][COLOR=#000000][FONT=Calibri][SIZE=3][COLOR=#000000] txtHOURS =TypeHrRNG.Value[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]End Sub
[/COLOR][/SIZE][/FONT]
And then the button that executes the button
Code:
[FONT=Times New Roman][SIZE=3][COLOR=#000000]
[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]Private Sub CommandButton3_Click()[/COLOR][/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3][COLOR=#000000][FONT=Calibri][SIZE=3][COLOR=#000000] TypeHrRNG = txtHOURS.Value[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3][COLOR=#000000][FONT=Calibri][SIZE=3][COLOR=#000000] Unload Me[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] ActiveCell.Rows("1:" &Selection.Rows.Count).EntireRow.EntireRow.AutoFit[/COLOR][/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3][COLOR=#000000][FONT=Calibri][SIZE=3][COLOR=#000000] Range("a17").Select[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3][COLOR=#000000]
[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]End Sub
[/COLOR][/SIZE][/FONT]
Open to any and all ideas.
Thanks in advance.
Last edited: