【发布时间】:2016-06-17 17:18:52
【问题描述】:
您好,我在 StackOverflow 上找到了这段代码,我想知道如何修改它(请参阅下面的代码截图...)
Sub TestMacro()
Dim dblRow As Double, dtDate As Date, strProject As String
Dim strFalut As String, strProb As String, strSol As String
dblRow = InputBox("Input on What Row?")
dtDate = InputBox("Date", , Date)
strProject = InputBox("Project #")
strFalut = InputBox("Fault")
strProb = InputBox("Problem")
strSol = InputBox("Solution")
Range("A" & dblRow).Value = dtDate
Range("B" & dblRow).Value = strProject
Range("C" & dblRow).Value = strFalut
Range("D" & dblRow).Value = strProb
Range("E" & dblRow).Value = strSol
End Sub
这是执行我希望它执行的功能的良好开端...但是我想知道如何使用 vLookUp 对其进行修改以搜索下一个空行并开始在那里输入数据而不必手动定义一行,这可能会导致操作员错误,因为这些行变得更多...
【问题讨论】:
-
学习UserForm的好机会,6个输入框不好。如果您有一个项目、故障、问题、解决方案列表表,您可以使用 ComboBox。日期的日期选择器。