我上面的Excel-VBA代码有什么问题? [英] What's wrong with my above Excel-VBA code?

查看:61
本文介绍了我上面的Excel-VBA代码有什么问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望VBA实现的简要说明:我正在尝试从两个Excel电子表格中导入数据,然后比较每个列表中的数据以找到每个列表中缺少的元素,然后突出显示数据行(如果有的话)丢失了.

Brief description of what i want my VBA to achieve: I'm trying to import data from two Excel spreadsheets, and then compare the data on each list to find the missing elements in each list and then highlight the data row if it is missing.

推荐答案

运行差值需要某种顺序.必须先调用Import_buttonx,然后才能调用差异.因此您会失去索引,因为stringOfSheet(1,2)可能没有任何值.可能是零.您可以在调试代码时进行检查.

Well there is a certain kind of order required to run Differences. Import_buttonx has to be called before Differences can be called. So you get an out of index because stringOfSheet(1,2) probably ha no value. It's probably nil. You can check while debugging through your code.

这篇关于我上面的Excel-VBA代码有什么问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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