Excel percent adding macro

  • Thread starter Thread starter Fusto
  • Start date Start date
F

Fusto

When a user selects multiple cells in excel, and runs the macro, I need
an input box to appear requesting a number. That number is then the
percent amount that I want to times the cell by.

E.G
A1 = 1
A2 = 2
Inputbox = 7
A1 = 0.07
A2 = 0.14

Any assistance in this would be greatly appreciated...

Thanks
 
Try This.

It gives additional option of selecting the range you want to
increase/decrease with the second input box

Sub Macro6()
Dim myPercent
Dim myRange As Range

myPercent = InputBox("Enter Percentage Increase, ie 25, 35 ")
If myPercent < 1 Then myPercent = myPercent * 100
myPercent = myPercent / 100
Set myRange = Application.InputBox("Select target cells to adjust",
Type:=8)
For x = 1 To myRange.Cells.Count
myRange.Cells(x) = myRange.Cells(x) * myPercent
Next x

End Sub
 
Back
Top