从vbscript搜索Excel工作表 [英] search excel sheet from vbscript

查看:135
本文介绍了从vbscript搜索Excel工作表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个vbscript,可将一些数据输出到由脚本本身创建的excel电子表格中.

我想做的是通过调出查找对话框来提供一种用于搜索电子表格的方法.

我尝试在工作表上添加按钮

i have a vbscript that outputs some data into an excel spreadsheet which is created by the script itself.

What I am trying to do is provide a way for the use to search that spreadsheet by bringing up the find dialog.

I''ve tried adding a button to the sheet

objXL.ActiveSheet.Buttons.Add(303.75, 16.5, 60, 20).Select
objXL.ActiveSheet.Shapes("Button 1").Select
objXL.Selection.Characters.Text = "Search"
objXL.ActiveSheet.Shapes("Button 1").Select
objXL.Selection.OnAction = ????? '' has to be a macro in the sheet and as the sheet ''is generated by the script, can''t see how I can use this method
objXL.Range("A1").Select



并将脚本中其他位置的功能分配给其onAction,但这不起作用.

我知道所有用户都必须按CTRL + F进行搜索,但是实际上是在工作表上提供一个由脚本创建的搜索按钮会很有用.

请问有人对如何执行此操作有任何想法吗?

感谢



and assign a function elsewhere in the script to its onAction but this doesn''t work.

I know all the user has to do it hit CTRL+F if they want to search, but it would be useful to provide a search button actually on the sheet as its created by the script.

Does anyone have any ideas how to do this please?

Thanks

推荐答案

脚本运行时,它将获取驱动器的目录结构,并以结构化方式将其输出到excel.我希望能够在结果excel表格中包含一个按钮,供用户按下以调用查找"对话框,而不是他们必须按下CTRL + F.

或在结果表中包括一种供用户执行文件夹搜索的方法.

不管采用哪种解决方案,由于在vbscript中进行编码,都必须将其包含在excel工作表中.

我不知道该怎么做:(
As the script runs it gets the directory structure of a drive and outputs it to excel in a structured fashion. I wanted to be able to include a button on the resulting excel sheet for the user to press in order to call the find dialog, rather than them having to press CTRL+F.

Or include a way on the resulting sheet for the user to perform a search of the folders.

Whatever solution, it has to be included in the excel sheet as a result of coding in the vbscript.

I can''t figure out how to do it :(


这篇关于从vbscript搜索Excel工作表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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