CraigTurnerEE
New Member
- Joined
- Mar 16, 2009
- Messages
- 5
Hey Guys, I am getting my butt kick with this user form, I am creating. I am trying to use a user form to simplify our time sheet application.
I trying to enter 2 cells of information(Project # and Project Description) from the user form to the excel sheet "daily", depending on which day of the week that is selected. Starting on the cell C6, then if information is entered, on that day, then it goes to the next line.
Currently, Everything else is working but, I keep righting over the same line over and over.
I am used a similar code string before, and never had a problem with it going to the next line, can anyone help? I have to be missing something, and now I am frustrated with not being able to fix it. See sub below:
Private Sub EnterProjectInformation_Click()
Dim ws1 As Worksheet
Set ws1 = Worksheets("Daily")
Dim Icolumn As Long
Dim iRow As Long
'find first empty row on "daily Sheet"
iRow = ws1.Cells(Rows.Count, 1).End(xlUp).Offset(5, 0).Row
'Set Day of the Week
If Trim(Me.DayofWeek_Combobox.Value) = "Thursday" Then
Icolumn = 3
End If
If Trim(Me.DayofWeek_Combobox.Value) = "Friday" Then
Icolumn = 7
End If
If Trim(Me.DayofWeek_Combobox.Value) = "Saturday" Then
Icolumn = 11
End If
If Trim(Me.DayofWeek_Combobox.Value) = "Sunday" Then
Icolumn = 15
End If
If Trim(Me.DayofWeek_Combobox.Value) = "Monday" Then
Icolumn = 20
End If
If Trim(Me.DayofWeek_Combobox.Value) = "Tuesday" Then
Icolumn = 24
End If
If Trim(Me.DayofWeek_Combobox.Value) = "Wednesday" Then
Icolumn = 28
End If
'Write Data to Sheet
ws1.Cells(iRow, Icolumn).Value = Me.ProjectDescription_Text.Value
ws1.Cells(iRow, Icolumn - 1).Value = Me.ProjectNumber_Text.Value
'Clear Data
Me.ProjectDescription_Text = ""
Me.ProjectNumber_Text = ""
Me.ProjectNumber_Text.SetFocus
I trying to enter 2 cells of information(Project # and Project Description) from the user form to the excel sheet "daily", depending on which day of the week that is selected. Starting on the cell C6, then if information is entered, on that day, then it goes to the next line.
Currently, Everything else is working but, I keep righting over the same line over and over.
I am used a similar code string before, and never had a problem with it going to the next line, can anyone help? I have to be missing something, and now I am frustrated with not being able to fix it. See sub below:
Private Sub EnterProjectInformation_Click()
Dim ws1 As Worksheet
Set ws1 = Worksheets("Daily")
Dim Icolumn As Long
Dim iRow As Long
'find first empty row on "daily Sheet"
iRow = ws1.Cells(Rows.Count, 1).End(xlUp).Offset(5, 0).Row
'Set Day of the Week
If Trim(Me.DayofWeek_Combobox.Value) = "Thursday" Then
Icolumn = 3
End If
If Trim(Me.DayofWeek_Combobox.Value) = "Friday" Then
Icolumn = 7
End If
If Trim(Me.DayofWeek_Combobox.Value) = "Saturday" Then
Icolumn = 11
End If
If Trim(Me.DayofWeek_Combobox.Value) = "Sunday" Then
Icolumn = 15
End If
If Trim(Me.DayofWeek_Combobox.Value) = "Monday" Then
Icolumn = 20
End If
If Trim(Me.DayofWeek_Combobox.Value) = "Tuesday" Then
Icolumn = 24
End If
If Trim(Me.DayofWeek_Combobox.Value) = "Wednesday" Then
Icolumn = 28
End If
'Write Data to Sheet
ws1.Cells(iRow, Icolumn).Value = Me.ProjectDescription_Text.Value
ws1.Cells(iRow, Icolumn - 1).Value = Me.ProjectNumber_Text.Value
'Clear Data
Me.ProjectDescription_Text = ""
Me.ProjectNumber_Text = ""
Me.ProjectNumber_Text.SetFocus