Macro to update cell when a condition is met?

iAmPatch

Board Regular
Joined
Jan 13, 2015
Messages
86
Hi,

Would there be an easy to read and understand VBA code that updates a certain cell once a condition has been met? I'm currently trying to build a dynamic Inventory Sheet but got stuck at this part.

Right now I have a column wherein it's labeled as "Vendor Balance". It identifies how many more items are pending from our supplier. Once it reaches "0"; we would like the cell to be automatically updated to "Complete". Is this possible?

Thank you :)
 
Not sure why but in your original post you said:
Concatenates Column C and D? Then have the result reflected in Column A

The On Error part was in case someone enter a text value into a cell when they should enter a number value
It's probable error outing now because you changed your requirements

I can assure you it worked for me.
When you remove error catching code and someone enters a text value into a cell when they should enter a number value your script will lock up on you.

G+12 can not equal 14

I'm sorry, I should have said earlier on that I needed a pseudo code instead of a static code :(
Although the final code I posted earlier is the most final and those would be the actual cells where the info would be keyed in

Oh and I'm also learning how to create a UserForm; this would hopefully eliminate the instance of a person entering a text value into a cell where the value should be numerical
 
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Not sure what this means:
I needed a
pseudo code
instead of a static code
 
Upvote 0
oh i used the wrong term again :(
anyway, that code that i posted earlier would hopefully be the final code that i'll be using for the inventory tracking file
and hopefully it will not lock up as you've warned me
 
Upvote 0
Not sure how much modifying to the code you have done but it appears to me you are using column E in both scripts.

Not sure what your results in A will look like.
Does column A look like this

124789
Or
JohnDoe
 
Upvote 0
Only using Column E once
Here's the final list of columns of the inventory tracker that I'm building

[TABLE="width: 500"]
<tbody>[TR]
[TD]VendorItem
[/TD]
[TD]Date Ordered
[/TD]
[TD]PO Number
[/TD]
[TD]Item
[/TD]
[TD]Vendor
[/TD]
[TD]Onhand
[/TD]
[TD]Number of Items Ordered
[/TD]
[TD]Delivered
[/TD]
[TD]Delivery Date
[/TD]
[TD]Actual On Hand
[/TD]
[TD]Vendor Balance
[/TD]
[/TR]
[TR]
[TD]MGMPencil
[/TD]
[TD]4/4/2018
[/TD]
[TD]12345
[/TD]
[TD]Pencil
[/TD]
[TD]MGM
[/TD]
[TD]100
[/TD]
[TD]50
[/TD]
[TD]20
[/TD]
[TD]4/6/2018
[/TD]
[TD]120
[/TD]
[TD]30
[/TD]
[/TR]
</tbody>[/TABLE]

I'm hoping that the script won't lock up. Since I'll be the only one to input values as necessary
 
Last edited:
Upvote 0
Glad you know how to modify scripts to meet your needs. Excel Vba can do lots of things for you.
Glad I was able to help you.
Come back here to Mr. Excel next time you need additional assistance.
 
Upvote 0
Hi @My Aswer Is This

I have additional questions but not quite related to my previous queries... should I create another thread or is it ok to just you? :)

Thanks
You should start a new thread and I will help you there. This is what forum rules say. I will see your new post and see if I can help you.
 
Upvote 0

Forum statistics

Threads
1,224,825
Messages
6,181,191
Members
453,021
Latest member
pingpong7117

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
Back
Top