#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default Help Please

I have a range of data from B2:H88 which contains formulas also. I want to
devide the cell values in the range with 41. Is there any way to edit the
all cells in the range in one go to devide it with 41 other than individually
edit each cell. If it can be done with a macro please provide.

regards
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Help Please

Sub divideval()
Dim V As Double
Set r = Range("B2:H88")
V = 41
For Each rr In r
If rr.HasFormula Or IsEmpty(rr) Then
Else
rr.Value = rr.Value / V
End If
Next
End Sub

Will divide each value by 41, but will leave the formulas alone.
--
Gary''s Student - gsnu200739


"shaji" wrote:

I have a range of data from B2:H88 which contains formulas also. I want to
devide the cell values in the range with 41. Is there any way to edit the
all cells in the range in one go to devide it with 41 other than individually
edit each cell. If it can be done with a macro please provide.

regards

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Help Please

On Sat, 25 Aug 2007 01:32:00 -0700, shaji
wrote:

I have a range of data from B2:H88 which contains formulas also. I want to
devide the cell values in the range with 41. Is there any way to edit the
all cells in the range in one go to devide it with 41 other than individually
edit each cell. If it can be done with a macro please provide.

regards


Select a blank cell.
Enter the number 41
Edit/Copy

Select your target range.

Edit/Paste Special/Divide

Constants will be divided by 41
Formulas will be placed inside parentheses and have /41 appended, so as to
divide the formula result by 41.
--ron
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Help Please

"Ron Rosenfeld" wrote in message
...
On Sat, 25 Aug 2007 01:32:00 -0700, shaji

wrote:

I have a range of data from B2:H88 which contains formulas also. I want
to
devide the cell values in the range with 41. Is there any way to edit the
all cells in the range in one go to devide it with 41 other than
individually
edit each cell. If it can be done with a macro please provide.

regards


Select a blank cell.
Enter the number 41
Edit/Copy

Select your target range.

Edit/Paste Special/Divide

Constants will be divided by 41
Formulas will be placed inside parentheses and have /41 appended, so as to
divide the formula result by 41.


.... which of course means that if a formula refers to a constant within the
range, that term will be divided by 41^2, and if there are further
references from one cell to another, that term will be divided by increasing
poweres of 41.
--
David Biddulph


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Help Please

On Sat, 25 Aug 2007 14:38:38 +0100, "David Biddulph" <groups [at]
biddulph.org.uk wrote:

... which of course means that if a formula refers to a constant within the
range, that term will be divided by 41^2, and if there are further
references from one cell to another, that term will be divided by increasing
poweres of 41.


I think the only way to avoid that, if, indeed, the OP wants to avoid it, would
be to convert all to constants.
--ron


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



All times are GMT +1. The time now is 10:07 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"