ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Need Help with what i thought was a SIMPLE Macro (https://www.excelbanter.com/excel-worksheet-functions/160253-need-help-what-i-thought-simple-macro.html)

Sharon

Need Help with what i thought was a SIMPLE Macro
 
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.

Peo Sjoblom

Need Help with what i thought was a SIMPLE Macro
 
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 editpaste
special and select multiply


--

Regards,

Peo Sjoblom




"sharon" wrote in message
...
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.




Pete_UK

Need Help with what i thought was a SIMPLE Macro
 
Post a copy of your macro, then we can advise on how to amend it.

Pete

On Sep 30, 8:17 pm, sharon wrote:
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.




Wondering[_2_]

Need Help with what i thought was a SIMPLE Macro
 
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

"sharon" wrote in message
...
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.




Sharon

Need Help with what i thought was a SIMPLE Macro
 
Sub times9()
'
' times9 Macro
' multiply cell contents by 9
'
' Keyboard Shortcut: Ctrl+r
'
ActiveCell.FormulaR1C1 = "=5*9"
Range("C5").Select
End Sub



"Pete_UK" wrote:

Post a copy of your macro, then we can advise on how to amend it.

Pete

On Sep 30, 8:17 pm, sharon wrote:
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.





Sharon

Need Help with what i thought was a SIMPLE Macro
 
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.


"Wondering" wrote:

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

"sharon" wrote in message
...
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.





Gord Dibben

Need Help with what i thought was a SIMPLE Macro
 
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

On Sun, 30 Sep 2007 13:36:01 -0700, sharon
wrote:

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.



Wondering[_2_]

Need Help with what i thought was a SIMPLE Macro
 
Are you multiplying a bunch of numbers one after another down a column or
just here and there in the spreadsheet?

"sharon" wrote in message
...
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.


"Wondering" wrote:

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

"sharon" wrote in message
...
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.







Sharon

Need Help with what i thought was a SIMPLE Macro
 
a few are contigous but others are here and there.

"Wondering" wrote:

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

"sharon" wrote in message
...
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.


"Wondering" wrote:

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

"sharon" wrote in message
...
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.







Sharon

Need Help with what i thought was a SIMPLE Macro
 
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.

"Gord Dibben" wrote:

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

On Sun, 30 Sep 2007 13:36:01 -0700, sharon
wrote:

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.





All times are GMT +1. The time now is 07:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com