|
查看: 1557|回复: 2
|
这里有人熟excel vba吗?
[复制链接]
|
|
|
我有个自己写的vlookup的code,可是如果太多data lookup时,会很消耗时间,可能要整2个小时(2万多个item),请问有谁可以帮忙改进吗?这是我的code:
- For cnt02 = r To IC02 + 1
- Range(Cells(p, 1), Cells(IR04, 1)) = Cells(p - 1, cnt02)
- For cnt03 = p To IR04
- Cells(cnt03, 1).Value = Cells(cnt03, 1) & Cells(cnt03, 2)
- Next cnt03
-
- Set rng01 = Range(Cells(p, cnt02), Cells(IR04 + p, cnt02))
- rng01 = Application.VLookup(Range(Cells(p, 1), Cells(IR05 + p, 1)), Worksheets("CBOM").Range("A:D"), 4, 0)
-
- Next cnt02
复制代码
我有一个idea就是每次vlookup过的item就会delete掉,可是不懂要怎样implement,希望各位帮帮忙,谢谢。 |
|
|
|
|
|
|
|
|
|
|
发表于 19-5-2011 04:49 PM
|
显示全部楼层
其实你要SET rng01的cell value?
可以用
- =VLookup(Range(Cells(p, 1), Cells(IR05 + p, 1)), Worksheets("CBOM").Range("A:D"), 4, 0))
复制代码 |
|
|
|
|
|
|
|
|
|
|
发表于 26-5-2011 10:19 AM
|
显示全部楼层
我有个自己写的vlookup的code,可是如果太多data lookup时,会很消耗时间,可能要整2个小时(2万多个item), ...
令狐冲 发表于 19-5-2011 09:31 AM 
可以解释你要做什么吗???
你的CODE。。。看不懂。。。
你说的被DELETE掉的是指.Cells(cnt03, 1).Value那边的? |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|