【发布时间】:2017-08-04 23:39:24
【问题描述】:
我有一个生成利用率公式的代码,但是,当我希望它以百分比为单位时,输出以 $ 显示。
有谁知道如何通过 VBA 完成这项工作?我知道如何通过普通的 excel 轻松更改它,但如果可能的话,我希望这个过程能够自动化。
到目前为止我有什么:
'Utilisation rates
With ActiveSheet
'Determine last row
Dim lastrow2 As Long
lastrow2 = .Cells(.Rows.Count, "F").End(xlUp).Row
'Copy the original values from column A to column B
.Range("H6:H" & lastrow2).Value = .Range("F6:F" & lastrow2).Value
'Copy / Pastespecial Divide using cell C3
.Range("C3").Copy
.Range("H6:H" & lastrow2).PasteSpecial Paste:=xlPasteValues, _
Operation:=xlDivide, _
SkipBlanks:=False, _
Transpose:=False
Application.CutCopyMode = False
End With
谢谢!!! (:
【问题讨论】:
-
另一个说明。您现在已经问了 MANY 个带有答案的问题,如果其中任何一个答案正确回答了您的问题,那么您应该通过单击正确答案旁边的复选标记将它们标记为正确。如果您不这样做,人们将停止回答您的问题。请返回并为您的每个问题标记一个正确答案,或者至少提供反馈,说明为什么它们不适合您。