📄 xlupd.vbs
字号:
'xlupd.vbs
'updates values in specific range based on criteria
'create new instance of Excel application
Set objExcel = CreateObject("Excel.Application")
With objExcel
.Visible = True
'load an existing spreadsheet
.Workbooks.Open "C:\data.xls"
Set objRange = .Range("Prices")
'go through each cell in the range
For Each objCell In objRange
'update cell value according to current value
If objCell.Value<100 Then
objCell.Value = objCell.Value * 1.04
ElseIf objCell.Value< 200 Then
objCell.Value = objCell.Value * 1.05
Else
objCell.Value = objCell.Value * 1.07
End If
Next
End With
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -