将具有特定YEAR值的整个行分割成其他工作表。 vba excel [英] splite the entire row with a specific YEAR value to other worksheet. vba excel

查看:94
本文介绍了将具有特定YEAR值的整个行分割成其他工作表。 vba excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几列数据,其中3列包含日期(日期格式为:dd / mm / yyyy)。现在,我想要excel根据3列中的YEAR将整行分隔成另一个工作表。

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.

在单元格(17,B)和(18,B)中,我输入年份作为参考(我希望excel可以分隔今年的行) 。 *这一年不是在绝对术语中,因此宏需要能够捕获单元格(17,B)和(18,B)中的值。

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).

例如:
如果我在单元格(18,B)中的单元格(17,B)和2012中键入2011希望通过3列(I至K)查看,如果列(I至K)的任何年份包含2011年和2012年,并将其粘贴到表2中,则复制整行。

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.

请看这个参考文件:
http://www.speedyshare.com/files/23779983/01.xls

在这个文件中,我想将整个行分开列(E到M)在片材1到片材2中。片材3大约是我想要的最终产品。我需要一个VBA代码。

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....

谢谢!我无法在google上找到相关信息...

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

推荐答案

您可以使用ADO与Excel: Excel:按行内容排列列

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

这篇关于将具有特定YEAR值的整个行分割成其他工作表。 vba excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆