Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi All,
I am not sure if this is the right forum for a VBA question, but I did not find a more suitable one. I have a large workbook that takes a very long time to re-calculate so I am forced to turn off auto calc while working. However I need to re-calc some specific cells every time I update their formulas. I have an XLA addin automatically load that has a sub for calculating ONLY the selected cells withough re-calc-ing the whole nine yards. Sub CalcSelected() Selection.Calculate End Sub I am getting errors, I even get an error if I move the sub into a module in the very spreadsheet I am working on. Does anyone know how to do this correctly? Thanks in advance! Stan |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Try this...........
Sub ConditionalRecalc() With Selection ..Calculate End With End Sub Vaya con Dios, Chuck, CABGx3 "Stan" wrote: Hi All, I am not sure if this is the right forum for a VBA question, but I did not find a more suitable one. I have a large workbook that takes a very long time to re-calculate so I am forced to turn off auto calc while working. However I need to re-calc some specific cells every time I update their formulas. I have an XLA addin automatically load that has a sub for calculating ONLY the selected cells withough re-calc-ing the whole nine yards. Sub CalcSelected() Selection.Calculate End Sub I am getting errors, I even get an error if I move the sub into a module in the very spreadsheet I am working on. Does anyone know how to do this correctly? Thanks in advance! Stan |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Chuck,
Thank you for your reply. I get an error when trying to execute your sub: Run-time error '1004': Calculate method of Range class failed When I hit Debug the ..calculate line is highlighted. This is the same error as before. I am fairly new to VBA and probably doing something silly - but for the life of me can not figure out what it is. Thanks again! Stan "CLR" wrote: Try this........... Sub ConditionalRecalc() With Selection .Calculate End With End Sub Vaya con Dios, Chuck, CABGx3 "Stan" wrote: Hi All, I am not sure if this is the right forum for a VBA question, but I did not find a more suitable one. I have a large workbook that takes a very long time to re-calculate so I am forced to turn off auto calc while working. However I need to re-calc some specific cells every time I update their formulas. I have an XLA addin automatically load that has a sub for calculating ONLY the selected cells withough re-calc-ing the whole nine yards. Sub CalcSelected() Selection.Calculate End Sub I am getting errors, I even get an error if I move the sub into a module in the very spreadsheet I am working on. Does anyone know how to do this correctly? Thanks in advance! Stan |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I dunno, it seems to work ok in my Excel 97. I can even use this variation,
having pre-named a non-contiguious range of cells "MyRange" Sub ConditionalRecalcOLD() Dim MyRange As Range Range("MyRange").Calculate End Sub I can only think that if you're using a newer version of Excel, something might have changed........ Maybe someone else here or in the Programming newsgroup might be familiar with the problem. Vaya con Dios, Chuck, CABGx3 "Stan" wrote: Chuck, Thank you for your reply. I get an error when trying to execute your sub: Run-time error '1004': Calculate method of Range class failed When I hit Debug the .calculate line is highlighted. This is the same error as before. I am fairly new to VBA and probably doing something silly - but for the life of me can not figure out what it is. Thanks again! Stan "CLR" wrote: Try this........... Sub ConditionalRecalc() With Selection .Calculate End With End Sub Vaya con Dios, Chuck, CABGx3 "Stan" wrote: Hi All, I am not sure if this is the right forum for a VBA question, but I did not find a more suitable one. I have a large workbook that takes a very long time to re-calculate so I am forced to turn off auto calc while working. However I need to re-calc some specific cells every time I update their formulas. I have an XLA addin automatically load that has a sub for calculating ONLY the selected cells withough re-calc-ing the whole nine yards. Sub CalcSelected() Selection.Calculate End Sub I am getting errors, I even get an error if I move the sub into a module in the very spreadsheet I am working on. Does anyone know how to do this correctly? Thanks in advance! Stan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cells are selected but aren't displayed as selected | Excel Discussion (Misc queries) | |||
Cells are selected but aren't displayed as selected | Excel Worksheet Functions | |||
Calculate Based on Drop Down Item Selected | Excel Worksheet Functions | |||
A validated List which link to selected cells according to what is selected on the list | Excel Worksheet Functions | |||
selected cells | Excel Worksheet Functions |