Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
221 views
in Technique[技术] by (71.8m points)

excel - VBA Create filter for multiple columns

good night!

I'm new in VBA and my english isn't that good so, please, be patient with me =D

Since I'm new, I always did simple loops, with one column. I never had to do a filter before. So I confess I have no idea where to begin. But I'll try my best to explain, so please, help me because it's really important to me.

I need to create a loop in the first 5 columns with this logic:

1 - Search all 5 columns and create a filter; 2 - Filter: Get all rows of column A where value == 1 And all rows of column B where value == 1 And all rows of Column C where variable == 'C' And all rows of column D where values == 1 And all rows of column E where value == 1 and create another sheet(1) with all rows of the filter; 3 - Do loop 2 again, but with "J" on column "C", and create another sheet (2);

The logic is: I need to create one sheet with all the rows that I set in the filter. Example: Find all rows on the Columns where Column A = 1 & Column B = 1 & Column C = F & Column D = 1 & Column E = 1 -> Create one sheet with all rows with this values

Just like that:

Note this: because I have Column C with "F" in a row and "J" in another row, I need to create one sheet with all rows that contains each letter.

enter image description here

Could you help me, please?

Thanks and have a great night!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...