Lectricman
New Member
- Joined
- Feb 18, 2016
- Messages
- 14
I hope someone can help me with this as it's driving me nuts.
iRow 3 and 4 are time values that may span more than 1 day.
For some reason the line of code in red, puts FALSE in the worksheet cell.
I have posted the whole procedure so you can see what is going on.
iRow 3 and 4 are time values that may span more than 1 day.
For some reason the line of code in red, puts FALSE in the worksheet cell.
I have posted the whole procedure so you can see what is going on.
Code:
Private Sub btnUpdate_Click()
Dim iRow As Long
Dim WS As Worksheet
Dim sheet As String
sheet = ComboBox1.Value
Set WS = Worksheets(sheet)
With WS
iRow = WS.Cells.Find(What:="*", SearchOrder:=xlRows, _
SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
.Cells(iRow, 1).Value = Me.txtWhen.Value
.Cells(iRow, 3).Value = Me.txtIn.Value
.Cells(iRow, 4).Value = Me.txtOut.Value
.Cells(iRow, 2).Value = Me.TextBox1.Value
[COLOR=#ff0000] .Cells(iRow, 5).Value = (Formula = "=MOD(iRow, 4-iRow, 3,1)")[/COLOR]
End With
With UserForm1
.txtIn.Value = ""
.txtOut.Value = ""
.ComboBox1.Value = ""
End With
End Sub