Changing Information Using InputBox Data as the Condition

AutoMation42

New Member
Joined
Oct 14, 2021
Messages
3
Office Version
  1. 365
  2. 2019
Platform
  1. 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.
 

Attachments

  • Code and Excel.jpg
    Code and Excel.jpg
    119.8 KB · Views: 10

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Akuini

Well-known Member
Joined
Feb 1, 2016
Messages
3,551
Office Version
  1. 365
Platform
  1. Windows
Hi, @AutoMation42. Welcome to the Forum.
... 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.
What about col "ID", could it be moved to another column?
 

AutoMation42

New Member
Joined
Oct 14, 2021
Messages
3
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi, @AutoMation42. Welcome to the Forum.

What about col "ID", could it be moved to another column?
It could be if it would make writing this coding easier but ideally it would stay where it is because in my actual spreadsheet (not the test one i provided) it is in a column that is several spaces away. Also I apologize for the late reply, work picked up quite drastically this last week so I didn't have time to check on my forum post.
 

AutoMation42

New Member
Joined
Oct 14, 2021
Messages
3
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi, @AutoMation42. Welcome to the Forum.

What about col "ID", could it be moved to another column?
Hi again Akuini,

It took me some time but after an immense amount of research and utilizing information provided on this forum and several others, I managed to piece together a solution to the problem I had listed. It is likely not the cleanest and could be trimmed up by someone with more knowledge than myself but nonetheless, I will post my solution this weekend for anyone that has had a similar problem to my own.
 

Forum statistics

Threads
1,147,747
Messages
5,742,964
Members
423,769
Latest member
LongToast

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top