Hello,
I have a workbook with 2 worksheets - Work_Order & Customer_Database. I would like to search for the value in M2(Work Ord No) of the Work_Order worksheet and perform a vlookup in column A of Customer_Database worksheet; if it finds the value, then I would like to display "PO Number Already Exists", otherwise, it will go into a loop until the last empty cell in column A and then copy the range V2:AP2 from Work_Order worksheet and paste in the last empty cell(column A) of Customer_Database worksheet.
I know how to copy and paste the range, as well as to perform the loop.
I have the following code:
Sub Save_Cust_Info()
Application.ScreenUpdating = True 'False
Sheets("Work_Order").Columns("T:AQ").EntireColumn.Hidden = True
Range("V2:AP2").Select
Selection.Copy
Sheets("Customer_Database").Select
Range("A1").Select
ActiveCell.Offset(1, 0).Select
Do While Not IsEmpty(ActiveCell)
ActiveCell.Offset(1, 0).Select
Loop
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False 'This line is utilized to overwrite existing data and also formats the data, removes coloring
Application.CutCopyMode = False
Sheets("Work_Order").Select
Range("Work_Ord_No").Select
'Application.Quit
End Sub
Thanks in advance for your help.
Best,
Manny
I have a workbook with 2 worksheets - Work_Order & Customer_Database. I would like to search for the value in M2(Work Ord No) of the Work_Order worksheet and perform a vlookup in column A of Customer_Database worksheet; if it finds the value, then I would like to display "PO Number Already Exists", otherwise, it will go into a loop until the last empty cell in column A and then copy the range V2:AP2 from Work_Order worksheet and paste in the last empty cell(column A) of Customer_Database worksheet.
I know how to copy and paste the range, as well as to perform the loop.
I have the following code:
Sub Save_Cust_Info()
Application.ScreenUpdating = True 'False
Sheets("Work_Order").Columns("T:AQ").EntireColumn.Hidden = True
Range("V2:AP2").Select
Selection.Copy
Sheets("Customer_Database").Select
Range("A1").Select
ActiveCell.Offset(1, 0).Select
Do While Not IsEmpty(ActiveCell)
ActiveCell.Offset(1, 0).Select
Loop
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False 'This line is utilized to overwrite existing data and also formats the data, removes coloring
Application.CutCopyMode = False
Sheets("Work_Order").Select
Range("Work_Ord_No").Select
'Application.Quit
End Sub
Thanks in advance for your help.
Best,
Manny