View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dale Hymel Dale Hymel is offline
external usenet poster
 
Posts: 9
Default Excel percent adding macro

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


"Fusto" wrote in message
...
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


---
Message posted from http://www.ExcelForum.com/