divide all numbers in range by a fixed number

D

dhig3903

I want to be able to type numbers into fields and have Excel
automatically divide that number by .88 in order to obtain a selling
price for our inventory.

I think I am making this a lot harder than it really is.

Any help would be greatly appreciated!!
 
G

Gord Dibben

You can do it while you enter by using event code which can be copy/pasted from
here to a sheet module.

Right-click on the sheet tab and "View Code". Paste the code into that module.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in any cell in Col A
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
n = Target.Row
If Excel.Range("A" & n).Value <> "" Then
Excel.Range("A" & n).Value = Excel.Range("A" & n).Value / 0.88
End If
End If
enditall:
Application.EnableEvents = True
End Sub

Alternative...........enter all the numbers then place .88 in an empty cell and
copy that cell.

Select all the number cells and Paste Special>Divide>OK>Esc.

Delete the cell with the .88


Gord Dibben MS Excel MVP
 
G

Guest

Take an empty cell... Type in "0.88"... copy... highlight all the cells that
has to be divided by this number... right click...paste special... select the
divide check box... ok

See if this works... This can be used for all operators... i.e.,
add/subtract/multiply or divide.

manoj
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top