I have been working on this tool inventory system for the shop I work at (machine shop).
Earlier today things were working ok, pretty much got it all running, was just spending some time debugging and cleaning up. Suddenly it's not working. I wasn't working in this area I don't recall but somehow I'm getting a type mismatch. I'm lost on this one.
I get a mismatch type on if activecell.value <> x then
.
Sub createOrder_BTN()
Dim x As String
Dim found As Boolean
Dim lRow As Long
Application.ScreenUpdating = False
Worksheets("Orders").Activate
Worksheets("Orders").Range("A4").Activate
'change to master sheet
Worksheets("Master").Activate
' Select first line of data.
Range("U3").Select
' Set search variable value.
x = ""
' Set Boolean variable "found" to false.
found = False
' Set Do loop to stop at empty cell.
Do Until IsEmpty(ActiveCell)
' change to master sheet
Worksheets("Master").Activate
' Check active cell for search value.
If ActiveCell.Value <> x Then
found = True
'MsgBox "Value found in cell " & ActiveCell.Address
ActiveCell.EntireRow.Copy
Worksheets("Orders").Activate
lRow = Cells.Find(What:="", _
After:=Range("A4"), _
LookAt:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
ActiveCell.Offset(1).Select
ActiveCell.PasteSpecial
End If
' change to master sheet
Worksheets("Master").Activate
' Step down 1 row from present location.
ActiveCell.Offset(1, 0).Select
Loop
Application.ScreenUpdating = True
Worksheets("Orders").Activate
End Sub