简体   繁体   English

根据条件将列复制并粘贴到另一张工作表

[英]Copy and paste columns to another sheet based on a criteria

How do I copy and paste columns from Sheet 1 to Sheet 2 which has the word "To" in its column headers? 如何将工作表1中的列复制并粘贴到工作表2中,在工作表2的列标题中有单词“ To”?

Example, Column H Header = 12/2/2014 To 14/2/2014 例如,H列标题= 12/2/2014至14/2/2014

I want to copy only these types of columns and paste it on another sheet. 我只想复制这些类型的列,然后将其粘贴到另一张纸上。

PS I'm looking for a non-vba solution (if there is one) so any help would be much appreciated. PS我正在寻找一种非vba解决方案(如果有的话),所以任何帮助将不胜感激。

I've tried using this formula but nothing happens. 我已经尝试过使用此公式,但没有任何反应。

=IF(COUNTIF(Sheet1!A$1,"*TO*"),Sheet1!A2,"")

PS I'm using Excel 2013. PS我正在使用Excel 2013。

You can use Find formula that will return the number of "To" for that. 您可以使用查找公式,该公式将为此返回“ To”的数字。

=IFERROR(FIND("To", A1, 1), "Did not found")

And in VBA you can use InStr that does almost the same operation. 在VBA中,您可以使用执行几乎相同操作的InStr。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过根据条件覆盖另一个工作表中的单元格来复制单元格和粘贴 - Copy cells and paste by overwriting cells in another sheet based on a criteria 如何根据条件复制值并将其粘贴到另一个工作表 - How to copy a value and paste it to another sheet based on a criteria 基于自动过滤器将粘贴列从一张工作表复制到另一张工作表 - Copy Paste Columns from one sheet to another sheet based on Autofilter 如何根据列中的条件将行从一张纸复制到另一张纸-仅粘贴值和格式(不粘贴公式)? - How to copy rows from one sheet to another based on criteria in column— paste only values and formatting (not formulas)? 根据特定条件将特定单元格值从一个工作表复制粘贴到另一个工作表 - Copy paste specific cell values from one work sheet to another based on a specific criteria VBA将工作表的某些列复制并粘贴到另一张工作表上的特定列 - VBA Copy and Paste Certain Columns of a sheet to specific columns on another sheet 根据条件复制和粘贴 - Copy and paste based on criteria 使用粘贴在某些条件下将单元格值从一张纸复制到另一张纸 - Copy Cell values from One Sheet to Another on certain criteria with the paste 如果满足两个范围标准,请复制第三个单元格并将其粘贴到另一张纸上 - If two range criteria are met, copy a third cell and paste it to another sheet 从工作表复制范围,然后粘贴到不同列的另一工作表中 - Copy range from a sheet and paste into another sheet in different columns
相关标签
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM