So to start, I'm super new at this and barely know what I'm doing. I'm trying to make a tracking sheet for logs that I get delivered to my sawmill. Ideally one of my employees can enter in the log characteristics in the userform and it will be transferred to a table to be tallied. I set up some if statements to choose a price based on species and grade. It works as intended when entered into a cell, however I was having trouble figuring out how to select the next row without the row being empty, so I had to remove the if statements and try to put them into the userform. When entered, I get a compile error for end of statement.
Any tips on how to fix this or generally set it up better?
Private Sub cbNext_Click()
'Find Empty Row
Dim rw As Integer
Dim ws As Worksheet
Set ws = Worksheets("Table")
rw = ws.Cells.Find(What:="*", SearchOrder:=xlRows, SearchDirection:=xlPrevious, LookIn:=xlFormulas).Row + 1
'Submit log data
ws.Cells(rw, 1).Value = Me.SpeciesList.Value
ws.Cells(rw, 2).Value = Me.tbLength.Value
ws.Cells(rw, 3).Value = Me.tbDiameter.Value
ws.Cells(rw, 4).Value = Me.tbSweep.Value
ws.Cells(rw, 5).Value = Me.tbCrook.Value
ws.Cells(rw, 6).Value = Me.LogGrades.Value
ws.Cells(rw, 7).Value = "=(((Table!C6-4)^2)*Table!B6)/16"
ws.Cells(rw, 8).Value = "=IF(F6="Tie",IF(A6="White Oak",Master!$B$5,IF(A6="Red Oak",Master!$B$5,Master!$B$2)),IF(F6="Blocking",Master!$B$3,IF(F6="Pallet",Master!$B$4,"-")))"
ws.Cells(rw, 9).Value = "=IF(H6=" - "," - ",H6*G6)"
Unload Me
Logs.Show
End Sub
Bookmarks