Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Dividing by fixed number

I want to replace a number of cells on a worksheet with new values. These
new values will be the existing value divided by 0.8775. I realise I can do
this by using EditPaste SpecialDivide - but I want to be able to see the
division in the Formula Bar rather than just the end value. At the moment,
I'm just going through on a cell-by-cell basis, and editing each one by
hand. Is there a quicker way to do this?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 427
Default Dividing by fixed number

Good morning, Colin-
Copy this bit of code and paste it in as a macro in your spreadsheet.
It modifies each formula in a range that you highlight and performs
that division you need.

Sub DivideBy()
Dim rCell As Range

For Each rCell In Selection.Cells
If Mid(rCell.Formula, 1, 1) < "=" Then rCell.Formula = "=" &
rCell.Formula
rCell.Formula = "=(" & Right(rCell.Formula, Len(rCell.Formula) - 1)
& ")/.8775"
Next rCell

End Sub

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
Addding a Random number to a fixed number..... Dermot Excel Discussion (Misc queries) 6 August 20th 06 12:17 PM
divide all numbers in range by a fixed number dhig3903 Excel Discussion (Misc queries) 2 August 9th 06 08:04 AM
vlookup with more than number to be retrieved martelie Excel Worksheet Functions 1 October 8th 05 07:33 AM
Add formula based on a fixed number Manos Excel Worksheet Functions 2 October 3rd 05 08:10 AM
Paste a function as a fixed number Martini25 Excel Discussion (Misc queries) 1 December 21st 04 11:39 AM


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