Need Help with what i thought was a SIMPLE Macro

G

Guest

I have a cell i want to multiply by 9. I have a lot of them. So I'd like a
macro with a shortcut to do it for me. For Example: cell c62 has a value of
177. I want it to have a value of 1593. Instead of manually editing each
cell (F2, home,=,end,*,9,enter) each and every time, a macro here would save
lots of time. Unfortunately when I write the macro, it works on the first
cell I wrote it on, but when I execute it on other cells it gives me the same
value of 1593 for each cell i try it on. It just inserts the formula =177*9
and the value 1593. Can anyone please help?? I'm stuck and it would sure
help. Thanks.
 
P

Peo Sjoblom

Try this.

First make a backup of your data, then put 9 in an empty cell, make sure the
cell is formatted the same way as the cells you want to change, then copy
the cell with 9, select all data you want to multiply and do edit>paste
special and select multiply
 
W

Wondering

You could put the following code in a module and assign it a shortcut key
such as Ctrl+m then select a cell and press Ctrl+m. If the cell is numeric,
the code multiplies the cell by 9.

Sub Multiply_by_9()
If IsNumeric(ActiveCell) Then
ActiveCell = ActiveCell * 9
End If
End Sub
 
G

Guest

Sub times9()
'
' times9 Macro
' multiply cell contents by 9
'
' Keyboard Shortcut: Ctrl+r
'
ActiveCell.FormulaR1C1 = "=5*9"
Range("C5").Select
End Sub
 
G

Guest

Thanks, I'll try this, too as soon as i figure out what a module is and where
they live (not being sarcastic, just don't know). Peo's solution worked as
well, but obliterated the original number (i.e. no formula to see what i did)
Thanks Peo that made short work of many many manual edifications.
 
G

Gord Dibben

The macros suggested will also obliterate the original number.

As far as "made short work" just open the backup copy you made before you tried
Peo's suggestion.


Gord Dibben MS Excel MVP
 
W

Wondering

Are you multiplying a bunch of numbers one after another down a column or
just here and there in the spreadsheet?
 
G

Guest

it was ok that peo's suggestion wiped out the original number. though i would
have preferred the formula to the final value, but i just footnoted the
multiplier so it worked out fine. thank you.
 

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