Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Named formula VBA insert error
I'm not sure if this a Worksheet Function issue or a VBA issue
because it involves both... I need to paste a named formula, using VBA into a vertical range of cells. I need the formula to add the value of the previous cell (the cell above the current cell) the result of a separate calculation in the formula. The VBA code is working and pasts the formula where I need it. The "separate calculation" is working In troubleshooting my problem I found: If I write the formula directly into the first cell and then copy and paste it manually into the rest of the range everything works fine. Formula as written in A114 and also in the "Refers To:" block for Name "BinSizeForm2" =A113+INDIRECT($C$114&"BinSize"&$D$114) As pasted in subsequent cells: =A114+INDIRECT($C$114&"BinSize"&$D$114) =A115+INDIRECT($C$114&"BinSize"&$D$114) =A116+INDIRECT($C$114&"BinSize"&$D$114) And so on... which works perfect Putting "=BinSizeForm2" in each cell returns the correct results also. The problem occurs when the name is written to the range cells using VBA; all cells end up with the same value (formula): =Htestc!A113+INDIRECT(Htestc!$C$114&"BinSize"&Htes tc!$D$114) Every cell starts with A113 instead of the previous cell reference. Help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Named Range Used in Formula Error | Excel Discussion (Misc queries) | |||
Insert Function next to formula bar gives Run-time Error '50290' | Excel Discussion (Misc queries) | |||
#REF error in named formula | Excel Worksheet Functions | |||
Array as a "named range" - formula ok in cells, but error as "named range" | Excel Discussion (Misc queries) | |||
HELP! Lost data - need to insert formula but get error! | Excel Programming |