AutoMation42
New Member
- Joined
- Oct 14, 2021
- Messages
- 16
- Office Version
- 365
- 2019
- Platform
- Windows
Hi Everyone,
I am new to mrexcel and VBA coding. I have never taken a coding class and am completely new to VBA. I have been self teaching as I go before signing up for a couple VBA and SQL classes but I still do not understand a lot of the lingo so if you can help, please break it down as if you are talking to a baby. I hope that my current problem can be solved so I will do my best to explain it. I have a test spreadsheet with information on it. Of this information only 3 columns will matter, the ID, Test Paid to Date, and Test Cost Remaining. Now I will explain the formula references. The ID is simply an ID, the Paid to Date is a number value, and the Cost Remaining is a formula, the Paid to Date - Test Budget. This means what I desire to do would cause a circular reference if I pull formulas using VBA. Now I will explain what I want my coding to do (which it is currently failing to do likely because of poor understanding on my part). Ideally, an InputBox will pop up, I will type in the ID#, then the Test Cost Remaining value (not the formula because that would cause a circular reference) will be added to the Test Paid to Date. This will cause the Test Paid to Date to increase by the Test Cost Remaining and the Test Cost Remaining to be reduced by its own value resulting in Test Cost remaining being zeroed out (but the test cost remaining formula should not be changed). Additionally, new rows and columns are constantly being added and removed but the ones I am working with will always have the same column title even if they are not in the same location. Also, if an ID number that is typed in cannot be found, I want a message box to appear that says "The ID Entered Cannot be Found on this Spreadsheet." and then have the input box reappear to type in a different number. I haven't even attempted to add the message box part as I have no idea how. Attached is an image of the test spreadsheet and the incomplete rudimentary code that I have written so far. If anyone can help me accomplish this I would greatly appreciate it.
I am new to mrexcel and VBA coding. I have never taken a coding class and am completely new to VBA. I have been self teaching as I go before signing up for a couple VBA and SQL classes but I still do not understand a lot of the lingo so if you can help, please break it down as if you are talking to a baby. I hope that my current problem can be solved so I will do my best to explain it. I have a test spreadsheet with information on it. Of this information only 3 columns will matter, the ID, Test Paid to Date, and Test Cost Remaining. Now I will explain the formula references. The ID is simply an ID, the Paid to Date is a number value, and the Cost Remaining is a formula, the Paid to Date - Test Budget. This means what I desire to do would cause a circular reference if I pull formulas using VBA. Now I will explain what I want my coding to do (which it is currently failing to do likely because of poor understanding on my part). Ideally, an InputBox will pop up, I will type in the ID#, then the Test Cost Remaining value (not the formula because that would cause a circular reference) will be added to the Test Paid to Date. This will cause the Test Paid to Date to increase by the Test Cost Remaining and the Test Cost Remaining to be reduced by its own value resulting in Test Cost remaining being zeroed out (but the test cost remaining formula should not be changed). Additionally, new rows and columns are constantly being added and removed but the ones I am working with will always have the same column title even if they are not in the same location. Also, if an ID number that is typed in cannot be found, I want a message box to appear that says "The ID Entered Cannot be Found on this Spreadsheet." and then have the input box reappear to type in a different number. I haven't even attempted to add the message box part as I have no idea how. Attached is an image of the test spreadsheet and the incomplete rudimentary code that I have written so far. If anyone can help me accomplish this I would greatly appreciate it.