I've just got to grips with the basics of VBA but I need your expertise with a particular code. Looking at the data below, I would like the code to be written so if the the answer is yes is Column D (contractor info) I want the entire row to be cut and added to sheet 2. Sheet 2 would have the same headings. there will be no blanks at all.
District Work Request Audit Result Contractor Info provided
21 39NGWS D4 yes
81 01MNRK D4 No
81 01MQQZ D5 No
81 01MSCF D7 Yes
12 37JZLW D8 Yes
I'd be grateful if someone could help me with this.
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
I copied and pasted this in the workbook but to no avail. Please forgive my ignorance but I'm unable to run this macro when I press F5. As I said I'm a novice so please be patient with me.
Put the posted code within Sub MyCode() and End Sub lines in a module. Run it by pressing F5 within the Visual Basic editor, or from the workbook via Tools -> Macro menu.
Put the posted code within Sub MyCode() and End Sub lines in a module. Run it by pressing F5 within the Visual Basic editor, or from the workbook via Tools -> Macro menu.
Hi,
I did and it came with the following error:
Runtime Error '450'
wrong number of arguments or invalid property assignment
wrong number of arguments or invalid property assignment
dunno, which line?
i tested before posting, show the code as you have it
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
though from your picture you have no sheet with name of sheet2, change code to suit
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete