Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
try
Sub dividebyformula() For Each c In Selection c.Formula = "=" & c & "/3" Next End Sub -- Don Guillett SalesAid Software "Colin Macleod" wrote in message ... 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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks for this. Exactly what I wanted...
"Don Guillett" wrote in message ... try Sub dividebyformula() For Each c In Selection c.Formula = "=" & c & "/3" Next End Sub -- Don Guillett SalesAid Software "Colin Macleod" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Addding a Random number to a fixed number..... | Excel Discussion (Misc queries) | |||
divide all numbers in range by a fixed number | Excel Discussion (Misc queries) | |||
vlookup with more than number to be retrieved | Excel Worksheet Functions | |||
Add formula based on a fixed number | Excel Worksheet Functions | |||
Paste a function as a fixed number | Excel Discussion (Misc queries) |