ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Single Range for Multiple Operations (https://www.excelbanter.com/excel-discussion-misc-queries/109730-single-range-multiple-operations.html)

prakash

Single Range for Multiple Operations
 
Hi Experts,

1. I let the user select a row as range using
(Set EndCell = Application.InputBox("Select the range/cells",Type:=8)

2. Suppose user selects Row#3 in the foll example:
ColA ColB ColB ColD ColE
Row1 5 7 8 6 8
Row2 7 5 7 4 0
Row3 5 6 7 9 10
Row4 4 4 4 3 2

I want to use value 5 under ColA for calculation 1
I want to use value 6 under ColA for calculation 2
I want to use value 7 under ColA for calculation 3
I want to use value 9 under ColA for calculation 4
I want to use value 10 under ColA for calculation 5

How do I use the values of one row and different columns for different
calculations? Without prompting the user to select value of Row3 and columnA
for calculation 1 and so on...

Thanks in advance for your great help





Toppers

Single Range for Multiple Operations
 
Set rg=Application.InputBox("Select the range/cells",Type:=8)
r=rg.row

For c=1 to 5 '<== columns A to F

mycalc=rg(c)* ....

OR

mycalc=cells(r,c)*....

next c


"Prakash" wrote:

Hi Experts,

1. I let the user select a row as range using
(Set EndCell = Application.InputBox("Select the range/cells",Type:=8)

2. Suppose user selects Row#3 in the foll example:
ColA ColB ColB ColD ColE
Row1 5 7 8 6 8
Row2 7 5 7 4 0
Row3 5 6 7 9 10
Row4 4 4 4 3 2

I want to use value 5 under ColA for calculation 1
I want to use value 6 under ColA for calculation 2
I want to use value 7 under ColA for calculation 3
I want to use value 9 under ColA for calculation 4
I want to use value 10 under ColA for calculation 5

How do I use the values of one row and different columns for different
calculations? Without prompting the user to select value of Row3 and columnA
for calculation 1 and so on...

Thanks in advance for your great help






All times are GMT +1. The time now is 04:35 AM.

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