Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.
I think it may be that I'm declaring the variables wrongly, and I've tried any number of types, but I keep getting the "Object variable or With block not set" error.
Public Sub UpdateOrders() On Error GoTo Err_Ctrl 'Exit sub if someone has the CallOff workbook open If IsFileOpen(GetMyPath() & "Call_Offs.xlsm") Then MsgBox "File is already open on another workstation!" & vbCrLf & _ "Please try again later and use the Update ShipNote option" Exit Sub End If Dim WBK1 As Workbook Dim WBK2 As Workbook Dim WS1 As Worksheet Dim WS2 As Worksheet Dim ColNum As Long Dim Pnum As String Dim RowNum As Long Dim OrderDate As Date Set WBK1 = ThisWorkbook Set WBK2 = Workbooks.Open(GetMyPath() & "Call_Offs.xlsm") Set WS1 = WBK1.Sheets("qryUploadOrders") Set WS2 = WBK2.Sheets("NonAutoBase") Do Until WS1.Range("A2") = "" Pnum = WS1.Range("A2") OrderDate = WS1.Range("B2") 'Find column ref ColNum = WS2.Range("DelDatez").Find(OrderDate, lookat:=xlWhole) 'Find row ref RowNum = WS2.Range("ProdPnumZ").Find(Pnum, lookat:=xlWhole) WS2.Range(RowNum, ColNum) = WS1.Range("C2") WS1.Range("A2").EntireRow.Delete Loop Exit_Sub: Exit Sub Err_Ctrl: MsgBox Err.Description Resume Exit_Sub End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.