循环浏览某些工作表并在工作簿中查找/复制特定行到第一张工作表 [英] Cycle Through Certain Worksheets and Find/Copy Particular Row To First Sheet in Workbook

查看:55
本文介绍了循环浏览某些工作表并在工作簿中查找/复制特定行到第一张工作表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。  我已经编写了下面的宏,因为我试图遍历特定的工作表,并从每个工作表中复制具有"Totals For:*"的整行。在该行的第一个单元格中。  我想将此行复制到名为 "数据总验证UAT2"的
工作表中。  任何想法这个代码有什么问题?  我在
收到运行时错误

Hello everyone.  I have written the macro below because I am trying to loop through specific worksheets and copy from each worksheet the entire row that has "Totals For: *" in the first cell of that row.  I want to copy this row to a sheet named "Data Total Validation UAT2".  Any ideas what is wrong with this code?  I am getting a run-time error at

" if ws.Cells(i,0)=" ; Totals For"然后"

"If ws.Cells(i, 0) = "Totals For" Then"

谢谢:D

_________________________________

_________________________________

Robert

推荐答案

更改为

f ws.Cells(i, 1) = "Totals For" Then"

单元格(行,列),其中行和列从1开始

Cells(line, column), where line and column starts at 1

单元格(1,1)=范围A1

Cells(1, 1) = range A1





这篇关于循环浏览某些工作表并在工作簿中查找/复制特定行到第一张工作表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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