I would like to create a code that works in the background.
In this case my code will check dates, calculations for total and Find cells. however, I don’t want it to pause my excel window. instead, I want to be able to work while those things are happening.
Is that possible?
I want to do this:
If Not Intersect(Target, ReportTab.Range("L2:L900000")) Is Nothing And Selection.Count = 1 Then
If ActiveCell.Value = "FIN - UPLOADED" Then
On Error GoTo ErrorbackupCategory
PoToFind = ActiveCell.Offset(0, -8).Value
INVToFind = ActiveCell.Offset(0, -9).Value
Do While worklogTab.Cells(wolc, 4).Value >= 0
If worklogTab.Cells(wolc, 4) = PoToFind And worklogTab.Cells(wolc, 3) = INVToFind Then
worklogTab.Cells(wolc, C#) = ActiveCell.Offset(0, -11)
worklogTab.Cells(wolc, Customer_Name) = ActiveCell.Offset(0, -10)
worklogTab.Cells(wolc, Document_Number) = ActiveCell.Offset(0, -9)
worklogTab.Cells(wolc, PO_Number) = ActiveCell.Offset(0, -8)
worklogTab.Cells(wolc, DateColumn) = ActiveCell.Offset(0, -7)
worklogTab.Cells(wolc, Due_Date) = ActiveCell.Offset(0, -6)
worklogTab.Cells(wolc, Current_Trx_Amount) = ActiveCell.Offset(0, -5)
worklogTab.Cells(wolc, PM_Owner) = ActiveCell.Offset(0, -4)
worklogTab.Cells(wolc, PM_Notes) = ActiveCell.Offset(0, -3)
worklogTab.Cells(wolc, Finance_Comments) = ActiveCell.Offset(0, -2)
worklogTab.Cells(wolc, NotesColumn) = ActiveCell.Offset(0, -1)
worklogTab.Cells(wolc, CategoryCOlumn) = ActiveCell
worklogTab.Cells(wolc, Uploaded_Date) = ActiveCell.Offset(0, 1)
worklogTab.Cells(wolc, Owner) = ActiveCell.Offset(0, 2)
worklogTab.Cells(wolc, Alert_Ticket_#) = ActiveCell.Offset(0, 3)
worklogTab.Cells(wolc, Requestor) = ActiveCell.Offset(0, 4)
Exit Do
ElseIf worklogTab.Cells(wolc, 4) = 0 Then
worklogTab.Cells(wolc, C#) = ActiveCell.Offset(0, -11)
worklogTab.Cells(wolc, Customer_Name) = ActiveCell.Offset(0, -10)
worklogTab.Cells(wolc, Document_Number) = ActiveCell.Offset(0, -9)
worklogTab.Cells(wolc, PO_Number) = ActiveCell.Offset(0, -8)
worklogTab.Cells(wolc, DateColumn) = ActiveCell.Offset(0, -7)
worklogTab.Cells(wolc, Due_Date) = ActiveCell.Offset(0, -6)
worklogTab.Cells(wolc, Current_Trx_Amount) = ActiveCell.Offset(0, -5)
worklogTab.Cells(wolc, PM_Owner) = ActiveCell.Offset(0, -4)
worklogTab.Cells(wolc, PM_Notes) = ActiveCell.Offset(0, -3)
worklogTab.Cells(wolc, Finance_Comments) = ActiveCell.Offset(0, -2)
worklogTab.Cells(wolc, NotesColumn) = ActiveCell.Offset(0, -1)
worklogTab.Cells(wolc, CategoryCOlumn) = ActiveCell
worklogTab.Cells(wolc, Uploaded_Date) = ActiveCell.Offset(0, 1)
worklogTab.Cells(wolc, Owner) = ActiveCell.Offset(0, 2)
worklogTab.Cells(wolc, Alert_Ticket_#) = ActiveCell.Offset(0, 3)
worklogTab.Cells(wolc, Requestor) = ActiveCell.Offset(0, 4)
Exit Do
End If
wolc = wolc + 1
Loop
ElseIf Not ActiveCell.Value = "FIN - UPLOADED" Then
PoToFind = ActiveCell.Offset(0, -8).Value
Do While worklogTab.Cells(wolc, 4) > 0
If worklogTab.Cells(wolc, 4) = PoToFind Then
worklogTab.Rows(wolc).Delete
Exit Do
End If
wolc = wolc + 1
Loop
Exit Sub
ErrorbackupCategory: MsgBox "Error ocurred at: " & "Backing-Up Uploads" & vbNewLine & "Error: " & ErrorBackingUp
Resume Next
End If
End If
New contributor
Manuel Mojica is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.