A1VBCode Forums

Excel 2010 - Script to Copy and Paste data to another sheet in same workbook if conditions are met


http://www.a1vbcode.com/vbforums/Topic31894.aspx

By skitso - 2/24/2013

Long time lurker, first time poster. It seems I can't find an answer to this one.



I want to scan Columns A,B,C,D,E,F for certain text within each row.



Start Scan at A12 in Sheet1 and Paste to Sheet2 at A8.



Start Scan

Search Column A for the word "Comment" Then

Search for the word "_Diag" in Column C Then

If Column D has "#" Then End scan of that row and go to the next

If there is a "$n" then replace with ""



So I only want to copy a row that has Comment in Column A the word _Diag in Column C and no # signs. If these conditions are met I want to skip that row and go to the next one.



I want to scan about 42,000 Row



After the scan is complete, I want to copy the rows that meet those conditions to Sheet 2 without having blank rows in between.



I can't find a template anywhere, and I'm fairly new to writing VBA. =\



any help would be greatly appreciated.