[英]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.