I have 2 ranges (each with headers and underlying text data) stacked on top of one another on the same worksheet. I am attempting to write a macro that autofilters the first range, copies and pastes data I need from each column to a separate worksheet, and then moves down to the second range (which is 2 blank rows below the end of range #1) to do the same thing. Filtering the first range is easy because it alway begins on row 11 but the 2nd is difficult for me because the first range always has a varying number of rows. here is a sample of the code I have that works for one of the columns in the top data range:
basically I'd like to just define both of these ranges so it will be easier to put into a loop. can anybody help? I have searched extensively for an answer to this but have been unable to figure it out.
ps-long time reader but first time I have come to the board with a post. even if this goes unanswered this board is a great thing and thank you to all who post here
Code:
ActiveSheet.Range("b11", Range("k11").End(xlDown)).AutoFilter Field:=1, Criteria1:="<>Zz"
Range("b11").End(xlDown).Offset(-2, 0).Select
If ActiveCell.Value = "" Then GoTo Skip
Range("b11", Range("b11").End(xlDown)).Copy
Sheets(1).Select
Range("b11").Select
ActiveSheet.Paste
Sheets(2).Select
Skip:
basically I'd like to just define both of these ranges so it will be easier to put into a loop. can anybody help? I have searched extensively for an answer to this but have been unable to figure it out.
ps-long time reader but first time I have come to the board with a post. even if this goes unanswered this board is a great thing and thank you to all who post here