'Using Evaluate to multiply values in a range
I am using the following code to multiply the values in a range by 2:
input_rng = Evaluate(input_rng.Address & "*2")
What if the multiplier is stored in a variable instead? I tried replacing 2 with the variable name and it didn't seem to work. Any suggestions?
Solution 1:[1]
I think Scott Craner's comment is spot on. Here's a full example in case it is helpful:
Sub test()
Dim input_rng As Range
Set input_rng = ActiveCell
Dim factor As Single
factor = 2
input_rng = Evaluate(input_rng.Address & "*" & factor)
End Sub
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Gove |
