Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following macro, but how do make it so it will do the calculation
for any cell I select instead of just the original cell? Range("F14").Select ActiveCell.FormulaR1C1 = "=IF(RC[-4]=""nv71pull"",(RC[-1]/192),(RC[-1] /150))" Thanks in advance for the help Bill R. God Bless -- John 3:16 "For God so loved the world that He gave His only begotten Son, so that whoever believes in Him shall not parish, but have eternal life" Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200708/1 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just take out the Range("F14").Select statement and the formula will
be placed in the active cell. If you need to loop through a range and pug in that formula, look at using a For...Next loop. bhrosey via OfficeKB.com wrote: I have the following macro, but how do make it so it will do the calculation for any cell I select instead of just the original cell? Range("F14").Select ActiveCell.FormulaR1C1 = "=IF(RC[-4]=""nv71pull"",(RC[-1]/192),(RC[-1] /150))" Thanks in advance for the help Bill R. God Bless -- John 3:16 "For God so loved the world that He gave His only begotten Son, so that whoever believes in Him shall not parish, but have eternal life" Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200708/1 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How would I do this for a group of cells? For example: I want to highlight
cells F14 : F26 and perform the same calculation in each of those cells. JW wrote: Just take out the Range("F14").Select statement and the formula will be placed in the active cell. If you need to loop through a range and pug in that formula, look at using a For...Next loop. I have the following macro, but how do make it so it will do the calculation for any cell I select instead of just the original cell? [quoted text clipped - 14 lines] Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200708/1 -- John 3:16 "For God so loved the world that He gave His only begotten Son, so that whoever believes in Him shall not parish, but have eternal life" Message posted via http://www.officekb.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just remove the:
Range("F14").Select without this line, the formula will go in the currently selected cell -- Gary''s Student - gsnu200740 "bhrosey via OfficeKB.com" wrote: I have the following macro, but how do make it so it will do the calculation for any cell I select instead of just the original cell? Range("F14").Select ActiveCell.FormulaR1C1 = "=IF(RC[-4]=""nv71pull"",(RC[-1]/192),(RC[-1] /150))" Thanks in advance for the help Bill R. God Bless -- John 3:16 "For God so loved the world that He gave His only begotten Son, so that whoever believes in Him shall not parish, but have eternal life" Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200708/1 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It's only doing the calculation for first cell of the highlighted group.
Here is the way my code looks now. Sub calculatepallets() ActiveCell.FormulaR1C1 = "=IF(RC[-4]=""nv71pull"",(RC[-1]/192),(RC[-1] /150))" End Sub Thanks Gary''s Student wrote: Just remove the: Range("F14").Select without this line, the formula will go in the currently selected cell I have the following macro, but how do make it so it will do the calculation for any cell I select instead of just the original cell? [quoted text clipped - 7 lines] Bill R. God Bless -- John 3:16 "For God so loved the world that He gave His only begotten Son, so that whoever believes in Him shall not parish, but have eternal life" Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200709/1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
If VBA Macro for Tiered Calculation | Excel Discussion (Misc queries) | |||
Macro Help for a BIG Calculation | Excel Discussion (Misc queries) | |||
Product calculation macro | New Users to Excel | |||
MACRO TO SET THE AUTOMATIC CALCULATION | Excel Discussion (Misc queries) | |||
Run a macro when cell changes (due to calculation!) | Excel Programming |