Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-02-2019, 07:33 AM
johnsail johnsail is offline Formula update using VBA Windows XP Formula update using VBA Office 97-2003
Novice
Formula update using VBA
 
Join Date: Jun 2019
Posts: 3
johnsail is on a distinguished road
Default Formula update using VBA

Hi Excel 2003


I have a formula that includes a range eg $AA$2:$AA$200.

If I insert a cell within that range my formula gets updated to $AA$2:$AA$201.

If I try the same by VBA the formula does not get updated.

Anybody help me out here?

John
Reply With Quote
  #2  
Old 06-05-2019, 02:45 AM
p45cal's Avatar
p45cal p45cal is online now Formula update using VBA Windows 10 Formula update using VBA Office 2016
Expert
 
Join Date: Apr 2014
Posts: 863
p45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant future
Default

I can't reproduce the problem here.
What's the code you use to insert a cell?
A workbook with the problem would be better still.
Reply With Quote
  #3  
Old 06-08-2019, 04:31 AM
johnsail johnsail is offline Formula update using VBA Windows XP Formula update using VBA Office 97-2003
Novice
Formula update using VBA
 
Join Date: Jun 2019
Posts: 3
johnsail is on a distinguished road
Default

thanks for the reply - sorry for the delay in getting back.
Have attached sample sheet (one empty line above the red border.
Starting in col A curser does exactly as required - jumping back to col A after stopping on each field that requires data entry (col I and M can remain empty).
All I am wanting to do is to insert cells A to M above the red line (and below the line just entered) that contains the correct formulas in the line ready for the next entry and updates the formulas using the extended column lengths.

I know it is simple but I just can't get the code right - DOH!

Regards
John
Attached Files
File Type: xls hourTEST.xls (144.5 KB, 7 views)
Reply With Quote
  #4  
Old 06-09-2019, 04:26 AM
p45cal's Avatar
p45cal p45cal is online now Formula update using VBA Windows 10 Formula update using VBA Office 2016
Expert
 
Join Date: Apr 2014
Posts: 863
p45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant future
Default

A number of points:
1. Did you know you can change the direction of travel the cursor/selected cell goes in after you press Enter from down one cell to right one cell?
2. You can lock cells, then protect the sheet and choose the option of the user not being able to select locked cells, then when the user enters a value and presses Enter, the selection jumps to the next unlocked cell in the direction opted for in point 1 above.
3. If you convert your table into a proper Excel Table (I think it's a List in older versions of Excel), when you add rows at the bottom of the table, the table expands and formulae outside the table adjust to accommodate the whole table.

So you may need very little code indeed.

But, and it's a big but, I'm not sure if Excel 97-2003 version works in the same way (the version of Excel the file you attached seems to have been made by). So before I offer a solution, can you confirm which version of Excel you are using? If it's an older version I'm going to have to use a computer I don't use any more which has this old version on it to confirm what I've said above and work out another solution(s) for you.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to update lastname with the help of V-Lookup formula? Mangesh1212 Excel 6 12-05-2018 02:15 AM
Formula update using VBA Macro to constantly update Field Formula Eduardo Care Excel 1 08-31-2015 01:25 PM
Formula update using VBA Auto update in formula/Obtain the name of the cell Eduardo Care Word 2 08-26-2015 04:45 PM
Formula update using VBA I want to use formula to auto update cells with information Steve81uk Excel 15 01-09-2015 12:58 PM
Formula update using VBA Macro not Performing Formula Update as Expected tandchas Excel Programming 7 06-27-2014 05:42 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:33 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft