Relative Content

Tag Archive for excelvba

How to add row and delete row as I check and unchecked items on my ListBox1?

Sub Rectangle5_Click() Dim xSelShp As Shape, xSelLst As Variant, I As Integer Dim xRow As Integer Set xSelShp = ActiveSheet.Shapes(Application.Caller) Set xLstBox = ActiveSheet.ListBox1 ‘ If the listbox is not visible, make it visible and load the previously selected items into the listbox If xLstBox.Visible = False Then xLstBox.Visible = True xSelShp.TextFrame2.TextRange.Characters.Text = “OPEN LIST” […]

How to add row and delete row as I check and unchecked items on my ListBox1?

Sub Rectangle5_Click() Dim xSelShp As Shape, xSelLst As Variant, I As Integer Dim xRow As Integer Set xSelShp = ActiveSheet.Shapes(Application.Caller) Set xLstBox = ActiveSheet.ListBox1 ‘ If the listbox is not visible, make it visible and load the previously selected items into the listbox If xLstBox.Visible = False Then xLstBox.Visible = True xSelShp.TextFrame2.TextRange.Characters.Text = “OPEN LIST” […]

How to add row and delete row as I check and unchecked items on my ListBox1?

Sub Rectangle5_Click() Dim xSelShp As Shape, xSelLst As Variant, I As Integer Dim xRow As Integer Set xSelShp = ActiveSheet.Shapes(Application.Caller) Set xLstBox = ActiveSheet.ListBox1 ‘ If the listbox is not visible, make it visible and load the previously selected items into the listbox If xLstBox.Visible = False Then xLstBox.Visible = True xSelShp.TextFrame2.TextRange.Characters.Text = “OPEN LIST” […]

Excel VBA – add button programmatically with a user function – works only in Debug mode

I am trying to write an Excel user function in VBA that will allow a user to add a button wherever they need.
I already have a VBA routine that will ping an IP address shown in an excel cell. Suppose a user has spreadsheet with IP addresses in column A. I want to give them the ability to enter a function into e.g. B1: =PING (A1) and this will create a button in C1 called “START PING” which when pressed runs this ping routine on the IP address in A1. Depending on the result, the fill color of A1 can be set to be Green or Red.