Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
My friend wrote a short VBA macro for me (Excel), to calculate something. Problem is as the values in the cells it references change, it doesn't update the result - I have to type in the formula again and press "Enter" to manually update the info. How can I get it to autoupdate? Thanks

Under "Tools" "Options" you can switch calculations between manual and automatic.
I would guess that you may not want to have calculations on automatic if you re working with a very large/complicated spreadsheet.
If you are on manual calcs, then press F9 to calculate everything in every open workbook, or Shift+F9 to just calculate the sheet you are looking at.
If you want the code to do the calculation for you, then find the end of the macro and enter the following two lines (before 'End Sub'):Range("A1:A5").Calculate
Change the range to suit the range with your formula in it (if its a single cell, then use Range("A3").
Of course, you could just use:
ActiveSheet.Calculate instead, but if there are LOADS of calculations on your sheet, or some reason why you wouldn't want it to update, then this might cause you problems.
Hope this is what you were after - post back if you need any more help.
Tom

![]() |
Video Game Programing
|
repairing [mbr]
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |