Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range % Increase
I want to be able to select any given range of cells in my spreadsheet as
necessary and increase the numbers already in them by a percentage that I type into an InputBox. I'm familiar with the code for an Inputbox, but I'm struggling with how to tell Excel to move to each of the selected cells and perform the increase. The selected cells won't usually be in the same row or column, but rathered scattered about. Thanks! Steve C. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range % Increase
Steve:
try, Dim rng As Range p = InputBox("Input a percentage ", , 10) For Each rng In Selection rng.Value = rng.Value * Val(p) Next -- 天行健,君*以自強不息 地勢坤,君*以厚德載物 http://www.vba.com.tw/plog/ "Steve C" wrote: I want to be able to select any given range of cells in my spreadsheet as necessary and increase the numbers already in them by a percentage that I type into an InputBox. I'm familiar with the code for an Inputbox, but I'm struggling with how to tell Excel to move to each of the selected cells and perform the increase. The selected cells won't usually be in the same row or column, but rathered scattered about. Thanks! Steve C. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range % Increase
untested, but you shouldn't have to select the range.
just for each cell in rng.Name cell.value = cell.value*(your%) next cell -- Gary "Steve C" wrote in message ... I want to be able to select any given range of cells in my spreadsheet as necessary and increase the numbers already in them by a percentage that I type into an InputBox. I'm familiar with the code for an Inputbox, but I'm struggling with how to tell Excel to move to each of the selected cells and perform the increase. The selected cells won't usually be in the same row or column, but rathered scattered about. Thanks! Steve C. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range % Increase
Thanks! I will give it a try!
"chijanzen" wrote: Steve: try, Dim rng As Range p = InputBox("Input a percentage ", , 10) For Each rng In Selection rng.Value = rng.Value * Val(p) Next -- 天行健,君*以自強不息 地勢坤,君*以厚德載物 http://www.vba.com.tw/plog/ "Steve C" wrote: I want to be able to select any given range of cells in my spreadsheet as necessary and increase the numbers already in them by a percentage that I type into an InputBox. I'm familiar with the code for an Inputbox, but I'm struggling with how to tell Excel to move to each of the selected cells and perform the increase. The selected cells won't usually be in the same row or column, but rathered scattered about. Thanks! Steve C. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Number in cell increase with increase in font size. | Excel Discussion (Misc queries) | |||
HELP - 5% INCREASE | Excel Worksheet Functions | |||
Increase A2 by 15% | Excel Discussion (Misc queries) | |||
Hide individual/range cells and temporarily increase scale for printing | Excel Programming | |||
Increase a range size by X rows and x Columns... | Excel Programming |