Hi
I have a very simple query for something I am trying to do in Excel using VBA and hoping someone can help
In a spreadsheet lets say I have the following values in cells B5:B10
A B
5 4
6 9
7 5
8 6
9 11
10 5
I am looking for code that would define a percentage and then multiply each cell by a given percentage. For example lets say I had three percentage values ... 5%, 10%, 20%
I want to define those at the beginning of my code, and then say do
Cell B5 should be the value * percentage_2 (in this case 10%)
Cell B6 should be the value * percentage_3 (in this case 20%)
Cell B7 should be the value * percentage_1 (in this case 5%)
I'd like to define the Percentages at the start so that I can change those percentages and the code will run with new percentgae values .. but keeping the individual cells multiplied by the "correct percentage (eg "percentage_2")
I'm not sure I've explained that well !! Hopefully someone can see / understand what im trying to do !!
Thanks in advance,
JOnny
I have a very simple query for something I am trying to do in Excel using VBA and hoping someone can help
In a spreadsheet lets say I have the following values in cells B5:B10
A B
5 4
6 9
7 5
8 6
9 11
10 5
I am looking for code that would define a percentage and then multiply each cell by a given percentage. For example lets say I had three percentage values ... 5%, 10%, 20%
I want to define those at the beginning of my code, and then say do
Cell B5 should be the value * percentage_2 (in this case 10%)
Cell B6 should be the value * percentage_3 (in this case 20%)
Cell B7 should be the value * percentage_1 (in this case 5%)
I'd like to define the Percentages at the start so that I can change those percentages and the code will run with new percentgae values .. but keeping the individual cells multiplied by the "correct percentage (eg "percentage_2")
I'm not sure I've explained that well !! Hopefully someone can see / understand what im trying to do !!
Thanks in advance,
JOnny