Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub cmdMultyply_Click()
- Dim cell_value As Double
- Dim rng As Range
- Dim cell As Range
- Dim nmr As Variant
- Dim formula As String
- nmr = Application.InputBox("Insert a number.", "INPUT", Type:=1)
- If nmr = False Then Exit Sub
- Set rng = Selection
- For Each cell In rng
- If cell.Value <> "" Then
- cell_value = cell.Value
- formula = Replace(cell.FormulaLocal, "=", "")
- cell.FormulaLocal = "=(" & formula & ")" & "*" & nmr
- End If
- Next
- Unload Me
- End Sub
Add Comment
Please, Sign In to add comment