update multiple cells by a percentage

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a spreadsheet which extracts data from a anlaysis server cube.

This brings back multiple numeric figures which are budgets. I would like to
have a button which will update these figures by a percentage placed in a
cell. So if I put 10 in the cell and run function it will update all figures
by 10%.

Is this possible?
 
hi
Sub ibpc()
Dim pc As Range
Dim ib As Range
Set pc = Range("G4") '10%
Set ib = Range("F4") '100
ib = ib * (pc + 1) '110
End Sub

edit to fit your data
regards
FSt1
 
Thanks for the reply but if for example change the range for ib to F4:F20
will that do 10% increase on each individual cell or add them all together?

Also, the amount of rows returned can differ as basically I have 5 columns
of data which could have x amount of rows e.g.:

Basic Pay Overtime Substitution Retainer Other
£1,300.00 £106.00 £137.00 £133.00 £10.00
£800.00 £50.00 £60.00 £45.00 £5.00
£500.00 £56.00 £77.00 £88.00 £5.00

I presume I will have to select a range of the whole 5 columns? Is there
any way of just selecting those cells within this range which have numeric
value or are > 0 ?

Thanks for your help......
 
Further to this I have tried the coding with pc = <the cell with percentage
in it> and
ib with a single cell to be uplifted by this percentage. This works fine!

However if I change ib to be a range of cells it gives an error....

Basically I need a button that will update multiple fields by a percentage.
Please help!!! NB - I have refined the requirements and only cells in one
column (not five!!)need updating if that makes things bit easier!!
 

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

Back
Top