Worksheet_Change Add and remove button In Next Cell Based on Cell Value

mbrunstad

New Member
Joined
Jan 29, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I am trying to make it where Anytime you enter the number 100 or more in Range G4:G11 a button assigned the same macro is added to the next cell and fits.

When you delete the value in Column G or it is under 100 it deletes the button in column H.

Please, Please Help.

Thank you, In Advance
 

Attachments

  • Excel.PNG
    Excel.PNG
    10.7 KB · Views: 15

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
What would be in column H if not the button?

My thinking is that it would be a smoother interface if putting 100 (+) in column G resulted in a format/text change in column H. But no Button.
Double clicking on column H would check to see if its next to a 100, if so, run the macro, if not do nothing.

Adding and removing shapes frequently can result in bloated files and increases instability.
 
Upvote 0
Put this in the sheet's code module.
VBA Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Target.Column = 8 Then
        If Val(CStr(Target.Offset(0, -1).Value)) >= 100 Then
            Cancel = True
            ' code to run
        End If
    End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,933
Messages
6,175,471
Members
452,646
Latest member
tudou

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