Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
MS MS is offline
external usenet poster
 
Posts: 26
Default Macro to double values in a cell

I have a worksheet with values in one column. I need to go back to some of
those values and in the same cell, double them. Can anyone please help me
with a macro to do that? I tried it but when I run the macro I get the same
value as the one in the cell where the macro was made. I realise this has to
do with absolute and constant values but am not competent enough to correct
my macro.

Any help will be very appreciated. Many thanks

M Shroff
Canada

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 698
Default Macro to double values in a cell

Give this a go.

Select the cells you want to double and run this macro.

Sub DoubleIt()
Dim cell As Range
For Each cell In Selection
cell.Value = cell.Value + cell.Value
Next
End Sub

HTH
Regards,
Howard

"MS" wrote in message
...
I have a worksheet with values in one column. I need to go back to some of
those values and in the same cell, double them. Can anyone please help me
with a macro to do that? I tried it but when I run the macro I get the
same
value as the one in the cell where the macro was made. I realise this has
to
do with absolute and constant values but am not competent enough to
correct
my macro.

Any help will be very appreciated. Many thanks

M Shroff
Canada



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 461
Default Macro to double values in a cell

Im kind of wondering what you mean by "Some of those Values"?

Because if you just want to create a Key Shortcut... start up a Macro and
input the code...

ActiveCell.Formula = ActiveCell.Value * 2

This way you can click on the cell you want to multiply by two and either
run the macro or use the keyboard shortcut you created.

If you want to double all the values or theres a certain criteria you need
to meet in order to double the values, I will have to know what it is to
write up the code... but its very possible.

"MS" wrote:

I have a worksheet with values in one column. I need to go back to some of
those values and in the same cell, double them. Can anyone please help me
with a macro to do that? I tried it but when I run the macro I get the same
value as the one in the cell where the macro was made. I realise this has to
do with absolute and constant values but am not competent enough to correct
my macro.

Any help will be very appreciated. Many thanks

M Shroff
Canada

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
MS MS is offline
external usenet poster
 
Posts: 26
Default Macro to double values in a cell

Thank u AKphidelt. But you will have to bear with me (I am a total beginner)
when I ask where do I input the code? When I create a macro, I create a
short cut key and then perform the keystrokes to record the macro.

Thank you
M Shroff

"AKphidelt" wrote:

Im kind of wondering what you mean by "Some of those Values"?

Because if you just want to create a Key Shortcut... start up a Macro and
input the code...

ActiveCell.Formula = ActiveCell.Value * 2

This way you can click on the cell you want to multiply by two and either
run the macro or use the keyboard shortcut you created.

If you want to double all the values or theres a certain criteria you need
to meet in order to double the values, I will have to know what it is to
write up the code... but its very possible.

"MS" wrote:

I have a worksheet with values in one column. I need to go back to some of
those values and in the same cell, double them. Can anyone please help me
with a macro to do that? I tried it but when I run the macro I get the same
value as the one in the cell where the macro was made. I realise this has to
do with absolute and constant values but am not competent enough to correct
my macro.

Any help will be very appreciated. Many thanks

M Shroff
Canada

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 461
Default Macro to double values in a cell

Alright do this...

Go to Tools--- Macro--- Visual Basic Editor

In the Visual Basic Editor

Go to Insert--- Module

Then copy and paste this formula

Sub DoubleVal()
ActiveCell.Formula = ActiveCell.Value * 2
End Sub

Then go back to your Excel Spreadsheet

Go to Tools--- Macro--- Macros (w/ little green play button)

Then click on the Macro and go to Options
There you can place your keyboard shortcut

Let me know if this helps

"MS" wrote:

Thank u AKphidelt. But you will have to bear with me (I am a total beginner)
when I ask where do I input the code? When I create a macro, I create a
short cut key and then perform the keystrokes to record the macro.

Thank you
M Shroff

"AKphidelt" wrote:

Im kind of wondering what you mean by "Some of those Values"?

Because if you just want to create a Key Shortcut... start up a Macro and
input the code...

ActiveCell.Formula = ActiveCell.Value * 2

This way you can click on the cell you want to multiply by two and either
run the macro or use the keyboard shortcut you created.

If you want to double all the values or theres a certain criteria you need
to meet in order to double the values, I will have to know what it is to
write up the code... but its very possible.

"MS" wrote:

I have a worksheet with values in one column. I need to go back to some of
those values and in the same cell, double them. Can anyone please help me
with a macro to do that? I tried it but when I run the macro I get the same
value as the one in the cell where the macro was made. I realise this has to
do with absolute and constant values but am not competent enough to correct
my macro.

Any help will be very appreciated. Many thanks

M Shroff
Canada



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
MS MS is offline
external usenet poster
 
Posts: 26
Default Macro to double values in a cell

YOU ARE A GOD-SEND. It worked. It has saved me hours of work.

Many many thanks
M Shroff

"AKphidelt" wrote:

Alright do this...

Go to Tools--- Macro--- Visual Basic Editor

In the Visual Basic Editor

Go to Insert--- Module

Then copy and paste this formula

Sub DoubleVal()
ActiveCell.Formula = ActiveCell.Value * 2
End Sub

Then go back to your Excel Spreadsheet

Go to Tools--- Macro--- Macros (w/ little green play button)

Then click on the Macro and go to Options
There you can place your keyboard shortcut

Let me know if this helps

"MS" wrote:

Thank u AKphidelt. But you will have to bear with me (I am a total beginner)
when I ask where do I input the code? When I create a macro, I create a
short cut key and then perform the keystrokes to record the macro.

Thank you
M Shroff

"AKphidelt" wrote:

Im kind of wondering what you mean by "Some of those Values"?

Because if you just want to create a Key Shortcut... start up a Macro and
input the code...

ActiveCell.Formula = ActiveCell.Value * 2

This way you can click on the cell you want to multiply by two and either
run the macro or use the keyboard shortcut you created.

If you want to double all the values or theres a certain criteria you need
to meet in order to double the values, I will have to know what it is to
write up the code... but its very possible.

"MS" wrote:

I have a worksheet with values in one column. I need to go back to some of
those values and in the same cell, double them. Can anyone please help me
with a macro to do that? I tried it but when I run the macro I get the same
value as the one in the cell where the macro was made. I realise this has to
do with absolute and constant values but am not competent enough to correct
my macro.

Any help will be very appreciated. Many thanks

M Shroff
Canada

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
MS MS is offline
external usenet poster
 
Posts: 26
Default Macro to double values in a cell

Thank u for taking the time to reply. I used the other tip and it worked.
"Phew" saved me lots of work.

Appreciate your input
M Shroff

"L. Howard Kittle" wrote:

Give this a go.

Select the cells you want to double and run this macro.

Sub DoubleIt()
Dim cell As Range
For Each cell In Selection
cell.Value = cell.Value + cell.Value
Next
End Sub

HTH
Regards,
Howard

"MS" wrote in message
...
I have a worksheet with values in one column. I need to go back to some of
those values and in the same cell, double them. Can anyone please help me
with a macro to do that? I tried it but when I run the macro I get the
same
value as the one in the cell where the macro was made. I realise this has
to
do with absolute and constant values but am not competent enough to
correct
my macro.

Any help will be very appreciated. Many thanks

M Shroff
Canada




  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 461
Default Macro to double values in a cell

Glad I could help!!

"MS" wrote:

YOU ARE A GOD-SEND. It worked. It has saved me hours of work.

Many many thanks
M Shroff

"AKphidelt" wrote:

Alright do this...

Go to Tools--- Macro--- Visual Basic Editor

In the Visual Basic Editor

Go to Insert--- Module

Then copy and paste this formula

Sub DoubleVal()
ActiveCell.Formula = ActiveCell.Value * 2
End Sub

Then go back to your Excel Spreadsheet

Go to Tools--- Macro--- Macros (w/ little green play button)

Then click on the Macro and go to Options
There you can place your keyboard shortcut

Let me know if this helps

"MS" wrote:

Thank u AKphidelt. But you will have to bear with me (I am a total beginner)
when I ask where do I input the code? When I create a macro, I create a
short cut key and then perform the keystrokes to record the macro.

Thank you
M Shroff

"AKphidelt" wrote:

Im kind of wondering what you mean by "Some of those Values"?

Because if you just want to create a Key Shortcut... start up a Macro and
input the code...

ActiveCell.Formula = ActiveCell.Value * 2

This way you can click on the cell you want to multiply by two and either
run the macro or use the keyboard shortcut you created.

If you want to double all the values or theres a certain criteria you need
to meet in order to double the values, I will have to know what it is to
write up the code... but its very possible.

"MS" wrote:

I have a worksheet with values in one column. I need to go back to some of
those values and in the same cell, double them. Can anyone please help me
with a macro to do that? I tried it but when I run the macro I get the same
value as the one in the cell where the macro was made. I realise this has to
do with absolute and constant values but am not competent enough to correct
my macro.

Any help will be very appreciated. Many thanks

M Shroff
Canada

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Macro to double values in a cell

Maybe a selection change event macro would have been a good idea.

Biff

"AKphidelt" wrote in message
...
Glad I could help!!

"MS" wrote:

YOU ARE A GOD-SEND. It worked. It has saved me hours of work.

Many many thanks
M Shroff

"AKphidelt" wrote:

Alright do this...

Go to Tools--- Macro--- Visual Basic Editor

In the Visual Basic Editor

Go to Insert--- Module

Then copy and paste this formula

Sub DoubleVal()
ActiveCell.Formula = ActiveCell.Value * 2
End Sub

Then go back to your Excel Spreadsheet

Go to Tools--- Macro--- Macros (w/ little green play button)

Then click on the Macro and go to Options
There you can place your keyboard shortcut

Let me know if this helps

"MS" wrote:

Thank u AKphidelt. But you will have to bear with me (I am a total
beginner)
when I ask where do I input the code? When I create a macro, I
create a
short cut key and then perform the keystrokes to record the macro.

Thank you
M Shroff

"AKphidelt" wrote:

Im kind of wondering what you mean by "Some of those Values"?

Because if you just want to create a Key Shortcut... start up a
Macro and
input the code...

ActiveCell.Formula = ActiveCell.Value * 2

This way you can click on the cell you want to multiply by two and
either
run the macro or use the keyboard shortcut you created.

If you want to double all the values or theres a certain criteria
you need
to meet in order to double the values, I will have to know what it
is to
write up the code... but its very possible.

"MS" wrote:

I have a worksheet with values in one column. I need to go back
to some of
those values and in the same cell, double them. Can anyone
please help me
with a macro to do that? I tried it but when I run the macro I
get the same
value as the one in the cell where the macro was made. I realise
this has to
do with absolute and constant values but am not competent enough
to correct
my macro.

Any help will be very appreciated. Many thanks

M Shroff
Canada



  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Macro to double values in a cell

Maybe a selection change event macro would have been a good idea.

Or not, now that I think about it a little more!

Biff

"T. Valko" wrote in message
...
Maybe a selection change event macro would have been a good idea.

Biff

"AKphidelt" wrote in message
...
Glad I could help!!

"MS" wrote:

YOU ARE A GOD-SEND. It worked. It has saved me hours of work.

Many many thanks
M Shroff

"AKphidelt" wrote:

Alright do this...

Go to Tools--- Macro--- Visual Basic Editor

In the Visual Basic Editor

Go to Insert--- Module

Then copy and paste this formula

Sub DoubleVal()
ActiveCell.Formula = ActiveCell.Value * 2
End Sub

Then go back to your Excel Spreadsheet

Go to Tools--- Macro--- Macros (w/ little green play button)

Then click on the Macro and go to Options
There you can place your keyboard shortcut

Let me know if this helps

"MS" wrote:

Thank u AKphidelt. But you will have to bear with me (I am a total
beginner)
when I ask where do I input the code? When I create a macro, I
create a
short cut key and then perform the keystrokes to record the macro.

Thank you
M Shroff

"AKphidelt" wrote:

Im kind of wondering what you mean by "Some of those Values"?

Because if you just want to create a Key Shortcut... start up a
Macro and
input the code...

ActiveCell.Formula = ActiveCell.Value * 2

This way you can click on the cell you want to multiply by two and
either
run the macro or use the keyboard shortcut you created.

If you want to double all the values or theres a certain criteria
you need
to meet in order to double the values, I will have to know what it
is to
write up the code... but its very possible.

"MS" wrote:

I have a worksheet with values in one column. I need to go back
to some of
those values and in the same cell, double them. Can anyone
please help me
with a macro to do that? I tried it but when I run the macro I
get the same
value as the one in the cell where the macro was made. I
realise this has to
do with absolute and constant values but am not competent enough
to correct
my macro.

Any help will be very appreciated. Many thanks

M Shroff
Canada





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
Double-click to run macro? JAnderson Excel Discussion (Misc queries) 6 February 8th 07 10:01 PM
Retrieving Values from Cell with Macro Anift Setting up and Configuration of Excel 4 November 21st 06 05:22 AM
Compiling macro based on cell values simonsmith Excel Discussion (Misc queries) 1 May 16th 06 08:31 PM
Run macro on double click only famdamly Excel Discussion (Misc queries) 2 February 27th 06 12:15 PM
double lookup, nest, or macro? Josef.angel Excel Worksheet Functions 1 October 29th 04 09:50 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"