Guest User

Untitled

a guest
Nov 15th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. Private Sub cmdMultyply_Click()
  2. Dim cell_value As Double
  3. Dim rng As Range
  4. Dim cell As Range
  5. Dim nmr As Variant
  6. Dim formula As String
  7.  
  8. nmr = Application.InputBox("Insert a number.", "INPUT", Type:=1)
  9.  
  10. If nmr = False Then Exit Sub
  11.  
  12. Set rng = Selection
  13.  
  14. For Each cell In rng
  15. If cell.Value <> "" Then
  16. cell_value = cell.Value
  17. formula = Replace(cell.FormulaLocal, "=", "")
  18. cell.FormulaLocal = "=(" & formula & ")" & "*" & nmr
  19. End If
  20. Next
  21.  
  22. Unload Me
  23. End Sub
Add Comment
Please, Sign In to add comment