Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Number in cell increase with increase in font size. Value increases with increase in font.[_2_] Excel Discussion (Misc queries) 2 August 9th 07 01:58 PM
HELP - 5% INCREASE sjuncker Excel Worksheet Functions 3 February 12th 06 04:02 AM
Increase A2 by 15% Kellytwh Excel Discussion (Misc queries) 2 September 2nd 05 05:08 PM
Hide individual/range cells and temporarily increase scale for printing chris100[_2_] Excel Programming 3 July 17th 05 08:54 PM
Increase a range size by X rows and x Columns... quartz[_2_] Excel Programming 3 July 23rd 04 10:39 PM


All times are GMT +1. The time now is 05:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"