Howto update prises automaticly

  • Thread starter Thread starter Espen
  • Start date Start date
E

Espen

Hi.

I have som excel dokuments with many articles. They all have 3 price
kategories each.
Is there possible to update all of the prises at one using the forumal:

Price*1,05=NewPrice

The new price shold shold be like this; 2,00 3,00 4,00 and not 2,03 2,99
4,04.
How can i do this? Macro?

Espen
 
Espen,

Select the cells with the prices, and run the macro below. Answer with a whole number (for example,
5) when asked for the increase.

HTH,
Bernie
MS Excel MVP

Sub IncreaseValues()
Dim myC As Range
Dim myMult As Double

myMult = 1 + InputBox("Enter Whole Number Percent increase: e.g. 5 = 5%") / 100

If MsgBox("Multiplier is " & myMult & ". Is that correct?", vbYesNo) = vbNo Then Exit Sub

For Each myC In Selection.SpecialCells(xlCellTypeConstants, 1)
myC.Formula = "=ROUND(" & myC.Value & "*" & myMult & ",0)"
myC.Value = myC.Value
Next myC
End Sub
 
Back
Top