Clear cell on dropdown select

Hi, i have a ss attached, when a user selects "Edit" in B31, i want it to enter the word "Enter Target" in K31

if "Delete" or "No Change" is selected i want the cell to be clear

I need these to activate on changing of the dropdown box

You can see now the desired result is achieved through formula


Thanks
Book2.xlsx
Seamus2626Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rgonzo1971Commented:
Hi,

I suppose it is an extension of your previous question (Q_28500836)

Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("B31:B59")) Is Nothing And Target.Rows.Count = 1 Then
        If Target.Value = "Delete" Or Target.Value = "No Change" Then
            pw = InputBox("Enter password to delete.", "Password Required")
            If pw = "rumin8" Then
                Me.Unprotect Password:="obfuscate"
                Target.Offset(0, 9).ClearContents
                Me.Protect Password:="obfuscate"
            End If
        ElseIf Target.Value = "Edit" Then
            pw = InputBox("Enter password to edit.", "Password Required")
            If pw = "rumin8" Then
                varValue = InputBox("Enter new value:", "Edit Value")
                If varValue <> "" Then
                    Me.Unprotect Password:="obfuscate"
                    Target.Offset(0, 9).Value = varValue
                    Me.Protect Password:="obfuscate"
                End If
            End If
        End If
    End If
End Sub

Open in new window

Regards
0
Seamus2626Author Commented:
Thanks Rgonzo, but i dont want any passwords,

its -

If B31 = "Edit" then K31 = "Enter target"

else K31 is blank

Thanks
0
Seamus2626Author Commented:
Apologies, let me restate
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Seamus2626Author Commented:
its -

If B31 = "Edit" then K31 = "Enter target"

if B31 = No change K31 = "=I31"

If B31 = "Delete" K31 = "=IF((I35-J35)<0,I35,(J35))"

Thanks
0
Rgonzo1971Commented:
Hi,

pls try

Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("B31:B59")) Is Nothing And Target.Rows.Count = 1 Then
        If Target.Value = "Delete" Then
            Target.Offset(0, 9).FormulaR1C1 = "=IF((RC[-2]-RC[-1])<0,RC[-2],RC[-1])"
        ElseIf Target.Value = "No Change" Then
            Target.Offset(0, 9).FormulaR1C1 = "=RC[-2]"
        ElseIf Target.Value = "Edit" Then
            Target.Offset(0, 9).Value = "Enter Target"
        End If
    End If
End Sub

Open in new window

Regards
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Seamus2626Author Commented:
Perfect! Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.