Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Change data value in a range of cells

I want to convert data value in a range of cells according to a specified
rule. For example, To divide the value in each cell by the value in the
first cell (row) in each column and multiply by 100.

1 2 100 100
2 3 200 150
3 4 To 300 200
4 5 400 250
5 6 500 300

If I enter formula for each cell one by one, it will be a very laboring
process. It seems there should be a simpler way to do this. Can someone
please help me? Thank you very much.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Change data value in a range of cells

Try entering your formula in the top cell of the range. You should then
see a little black box in the lower right hand corner of the cell. Click on
that and drag down as far as necessary.

HTH,
Barb Reinhardt



"turen" wrote:

I want to convert data value in a range of cells according to a specified
rule. For example, To divide the value in each cell by the value in the
first cell (row) in each column and multiply by 100.

1 2 100 100
2 3 200 150
3 4 To 300 200
4 5 400 250
5 6 500 300

If I enter formula for each cell one by one, it will be a very laboring
process. It seems there should be a simpler way to do this. Can someone
please help me? Thank you very much.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Change data value in a range of cells

Thanks for the reply. But this will only give me the same value as that in
the top cell. It seems I need to write a VB Script to select a range of
cells and then divide the value in each cell by certain value. hope someone
can tell me how to do that.

"Barb Reinhardt" wrote:

Try entering your formula in the top cell of the range. You should then
see a little black box in the lower right hand corner of the cell. Click on
that and drag down as far as necessary.

HTH,
Barb Reinhardt



"turen" wrote:

I want to convert data value in a range of cells according to a specified
rule. For example, To divide the value in each cell by the value in the
first cell (row) in each column and multiply by 100.

1 2 100 100
2 3 200 150
3 4 To 300 200
4 5 400 250
5 6 500 300

If I enter formula for each cell one by one, it will be a very laboring
process. It seems there should be a simpler way to do this. Can someone
please help me? Thank you very much.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 182
Default Change data value in a range of cells

I hope my post will give your correct query:

Sub test()
Dim r, c
For c = 1 To 2
For r = 1 To 5
If c = 1 Then
Cells(r, c) = r
Cells(r, c).Offset(0, 2) = _
Cells(r, c) * 100
ElseIf c = 2 Then
Cells(r, c) = r + 1
Cells(r, c).Offset(0, 2) = _
Cells(r, c) * 50
End If
Next r
Next c
End Sub

--
Regards,

Halim



"turen" wrote:

Thanks for the reply. But this will only give me the same value as that in
the top cell. It seems I need to write a VB Script to select a range of
cells and then divide the value in each cell by certain value. hope someone
can tell me how to do that.

"Barb Reinhardt" wrote:

Try entering your formula in the top cell of the range. You should then
see a little black box in the lower right hand corner of the cell. Click on
that and drag down as far as necessary.

HTH,
Barb Reinhardt



"turen" wrote:

I want to convert data value in a range of cells according to a specified
rule. For example, To divide the value in each cell by the value in the
first cell (row) in each column and multiply by 100.

1 2 100 100
2 3 200 150
3 4 To 300 200
4 5 400 250
5 6 500 300

If I enter formula for each cell one by one, it will be a very laboring
process. It seems there should be a simpler way to do this. Can someone
please help me? Thank you very much.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Change data value in a range of cells

Select your dataset and run this

'*****************
Sub Tester()

Dim col As Range, c As Range
Dim v

For Each col In Selection.Columns
v = col.Cells(1).Value
For Each c In col.Cells
c.Value = (c.Value / v) * 100
Next c
Next col

End Sub
'*****************

Tim

"turen" wrote in message
...
I want to convert data value in a range of cells according to a specified
rule. For example, To divide the value in each cell by the value in the
first cell (row) in each column and multiply by 100.

1 2 100 100
2 3 200 150
3 4 To 300 200
4 5 400 250
5 6 500 300

If I enter formula for each cell one by one, it will be a very laboring
process. It seems there should be a simpler way to do this. Can someone
please help me? Thank you very much.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Change data value in a range of cells

Thank you very much, Tim. It works perfectly. Thank you all for taking time
to reply.

Turen

"Tim Williams" wrote:

Select your dataset and run this

'*****************
Sub Tester()

Dim col As Range, c As Range
Dim v

For Each col In Selection.Columns
v = col.Cells(1).Value
For Each c In col.Cells
c.Value = (c.Value / v) * 100
Next c
Next col

End Sub
'*****************

Tim

"turen" wrote in message
...
I want to convert data value in a range of cells according to a specified
rule. For example, To divide the value in each cell by the value in the
first cell (row) in each column and multiply by 100.

1 2 100 100
2 3 200 150
3 4 To 300 200
4 5 400 250
5 6 500 300

If I enter formula for each cell one by one, it will be a very laboring
process. It seems there should be a simpler way to do this. Can someone
please help me? Thank you very much.




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
Change results , change data in othe cells across the row Jennifer1960 Excel Worksheet Functions 0 August 21st 06 10:37 PM
posted data in a range of cells can't change after three days andycapp Excel Programming 1 March 18th 06 01:25 PM
change range of cells to another currency Max-SR Excel Worksheet Functions 3 December 31st 05 07:18 PM
How do I change a range name back to the underlying data range? Colin Excel Worksheet Functions 1 September 26th 05 05:55 PM
Copy cells into range of cells until cell change mdeanda Excel Worksheet Functions 1 April 22nd 05 08:41 PM


All times are GMT +1. The time now is 04:52 PM.

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

About Us

"It's about Microsoft Excel"