Howto update prises automaticly

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
 
B

Bernie Deitrick

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top