VBA Clear Contents Expression

harvella

New Member
Joined
Mar 10, 2017
Messages
2
Hi,

I'm just starting to get into VBA because I spent most of my time working through everything in just recording macros. With the help of a co-worker I was able to create a way to enter data into a cell and then have it come back with a message box based on different criteria. What I can't figure out is how to change a cell if the original content cell is cleared or changed.

So far one of my challenges is that I don't yet know the language and how to properly ask questions, sorry if this doesn't make sense. Below is the expression I have for my file. What I need to do is if I change the value on a cell and it falls out of the range that will make a note the note gets deleted.

Does this make sense and does anybody have guidance?


Private Sub Incorrect_Amount_Will_Fix_Click()


End Sub


Private Sub CommandButton1_Click()
Dim mystring As String
Me.Hide
If Me.OptionButton1.Value = True Then
mycell.Offset(0, 5).Value = "High Inventory"
End If
If Me.OptionButton2.Value = True Then
mycell.Offset(0, 5).Value = "Low Inventory"
End If
If Me.OptionButton3.Value = True Then
mystring = InputBox("Enter Correct Amount")
mycell.Value = mystring
End If
End Sub


Private Sub UserForm_Activate()
Me.OptionButton1.Value = True


End Sub


Private Sub UserForm_Click()


End Sub
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hi Harvella,

Would be helpful if you can ask your coworker to draft the post.
Also, search internet for Worksheet.change event and target cell. Hope this is what you are looking for.


Regards,
DILIPandey
 
Upvote 0

Forum statistics

Threads
1,216,112
Messages
6,128,901
Members
449,477
Latest member
panjongshing

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