ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   update multiple cells by a percentage (https://www.excelbanter.com/excel-programming/391492-update-multiple-cells-percentage.html)

johnprez

update multiple cells by a percentage
 
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?

FSt1

update multiple cells by a percentage
 
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

"johnprez" wrote:

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?


johnprez

update multiple cells by a percentage
 
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......



"FSt1" wrote:

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

"johnprez" wrote:

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?


johnprez

update multiple cells by a percentage
 
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!!


"johnprez" wrote:

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......



"FSt1" wrote:

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

"johnprez" wrote:

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?



All times are GMT +1. The time now is 10:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com