View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default using a popup to make percenatges on selected cells

hi
Sub changenumber()
Dim n As Double
n = InputBox("enter a number")
n = n / 100 'changes to percent
For Each Cell In Selection
Cell.Value = Cell * n
Next Cell

End Sub

regards
FSt1


"Colin Hayes" wrote:


Hi

I'm hoping someone can help with some code.

I'm selecting a group of cells containing numbers. I want via a popup to
change the selected numbers to the percentage entered in the popup.

For example - I select my cells and run the macro. The popup asks for a
number and I enter '50'. All the selected numbers then change to 50
percent of their previous value. It would apply equally to a selected
whole column of numbers.

Grateful for any help.



Best Wishes
.