leatherhen99
New Member
- Joined
- Dec 17, 2019
- Messages
- 27
- Office Version
- 365
- Platform
- Windows
Hi All,
I know that this is probably an easy fix, but Event Handlers are not my language! I have an evaluation form that someone will fill out... there might be times that they have to load a previous evaluation and make updates... so... if cell D2 has a leader's name in it (it's a dropdown field), I want the (load button) "btn_Load" shape to be invisible... but if the field is empty, I want the button to be available.
Right now, it will remove the load button if a name is selected, but if the field is cleared, it won't put the button back... If I go change another cell, the button will appear after the other cell is changed, but not immediately when D2 is empty.
Suggestions? Recommendations?
Thank you
I know that this is probably an easy fix, but Event Handlers are not my language! I have an evaluation form that someone will fill out... there might be times that they have to load a previous evaluation and make updates... so... if cell D2 has a leader's name in it (it's a dropdown field), I want the (load button) "btn_Load" shape to be invisible... but if the field is empty, I want the button to be available.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Set rng = Range("D2")
If Not Intersect(Target, rng) Is Nothing Then
Shapes("btn_Update").Visible = msoFalse
Shapes("btn_Load").Visible = msoFalse
Shapes("btn_Clear").Visible = msoCTrue
Shapes("btn_Submit").Visible = msoCTrue
Else
Shapes("btn_Update").Visible = msoFalse
Shapes("btn_Load").Visible = msoCTrue
Shapes("btn_Clear").Visible = msoCTrue
Shapes("btn_Submit").Visible = msoCTrue
End If
Set rng = Nothing
End Sub
Right now, it will remove the load button if a name is selected, but if the field is cleared, it won't put the button back... If I go change another cell, the button will appear after the other cell is changed, but not immediately when D2 is empty.
Suggestions? Recommendations?
Thank you