我有一个包含许多行数据的电子表格.我希望能够使用该行中的数据单击将运行宏的单元格.由于行数总是在变化,我虽然每行的超链接可能是最好的方法.
ROW MeterID Lat Long ReadX ReadY ReadZ CoeffA CoeffB CoeffC
2 10f62gs 34.1 33.3 102.2 231.3 382.2 4.34 22.1 0.002
3 83gs72g 34.4 31.4 109.2 213.1 372.1 2.23 12.7 0.023
4 43gS128 33.3 32.2 118.8 138.7 241.8 1.94 5.08 0.107
Run Code Online (Sandbox Code Playgroud)
有没有办法通过单击超链接运行vba宏,并能够知道单击超链接的单元格行?
我正在尝试计算在Excel中完成分析所需的时间.我正在使用DateDiff来计算它所需的秒数,然后尝试以小时,分钟,秒为格式.
我的代码在下面导致溢出错误:
dTime = dTime / (60 * 60 * 24)
Run Code Online (Sandbox Code Playgroud)
你知道我做错了什么吗?
Dim dTime As Long
Dim startTime, endTime As Date
startTime = Now() ' at the start of the analysis
endTime = Now() ' at the end of the analysis
dTime = DateDiff("s", startTime, endTime)
dTime = dTime / (60 * 60 * 24) 'convert seconds into days
StatusBox.Value = "Analysis completed in " & Format(dTime, "hh:mm:ss") & "."
Run Code Online (Sandbox Code Playgroud)