Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

splite the entire row with a specific YEAR value to other worksheet. vba excel

I've got a few columns of data in which 3 columns contain dates (in date format : dd/mm/yyyy) . Now, I want excel to seperate the entire row into another worksheet according to the YEAR in the 3 columns.

In cell ( 17,B) and (18,B), i type in the year for reference ( which i want excel to seperate the rows accoding to this year) . * The year is not in "absolute term" and so the macro needs to be capable to capture the value in cell (17,B) and (18,B).

For example:: If i typed in "2011" in cell ( 17,B) and "2012" in cell ( 18,B), i want excel to look through the 3 columns (I to K),copy the entire row if the years in ANY of the column ( I to K) contains year of 2011 and 2012 and paste them in sheet 2.

Please take a look at this reference file: http://www.speedyshare.com/files/23779983/01.xls

In this file, i want to seperate the entire rows from column (E to M) in sheet 1 to sheet 2. And sheet 3 is approximately the final product i want. I need a VBA code for this....

Thanks! I couldn't find relavent information on google...

See Question&Answers more detail:os

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

1 Reply

0 votes
by (71.8m points)

You can use ADO with Excel: Excel: Sort columns by row content


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...