Excel vba shape onaction parameter OnAction = "Macro2" Of course, a macro named "Macro2" should exist in a standard module. Figure out what the proper syntax is in order to pass parameters to the OnAction routine. When I click the button nothing happens. Problem calling . Copy. Name & """'" And change your Action-routine Hi, I have a shape in my worksheet and I have defined onAction property to it. Note that you have to enclose the name of the checkbox in double quotes, so that you would get something like. Both workbooks are open at the save time. Most of the objects that inherit from Shapes usually exposes ShapeRange property that returns the Shape object. Type ‘returns the message “Check Box Form Control”, indicating the shape is a Form Control & is a Check Box Jul 30, 2012 · VBA Geniuses: Question 1: Is it possible to set the . ActiveSheet. OnAction = "'Testit ""a"",""b""'" ActiveSheet. Check If excel cell is empty. Caller will be the checkbox's name, and Evaluate returns the checkbox object itself. Parameter property. Type = msoAutoShape And Len(. That is why your code has Buttons and Shapes collections. g. Mar 1, 2005 · By saying that the userform could not also be the active object at the same time I was assuming the shape was on a sheet. shapes. Feb 4, 2016 · We can set a shape to run this macro using . MD - MicrosoftDocs/VB May 7, 2022 · Returns or sets the name of a macro that's run when the specified object is chosen. OnAction macro. This example sets the OnAction property for shape two in a Shapes collection. Asking for help, clarification, or responding to other answers. I cannot cycle all the VBA components as the VBAProject Aug 30, 2018 · You are starting in VBA, so you need to know the main difference between SUBS and FUNCTIONS. You may already know that you can insert shapes into a spreadsheet. Shapes. Feb 9, 2015 · I am trying to create an excel template where I have already assigned different macros to different shape that act as buttons. For more resources, see README. The parameter LinkToFile must be set to msoTrue and SaveWithDocument must be msoFalse to ensure the automatic updating of the pictures (when the workbook is opened again). I am trying to get the OnAction event to call another Sub I have in my VBA code. You need to set a string here. Shapes("Button 1"). Visio VBA: How to register to mouse double click event on a shape in VB code. Making statements based on opinion; back them up with references or personal experience. Item(2). This example creates a command bar named Custom, adds three buttons to it, and then uses the ActionControl property and the Tag property to determine which command bar button was last clicked. Make some form check boxes on a sheet Copy this code into a module (alt F11, insert, module) run SetMacro Save and test Jul 13, 2019 · Sorry for the long delay in reply. 75 - 5, 13, 13) Allocate manually a VBA procedure to the shape then compare what contains exactly its OnAction property with your string I want to assign a macro to Shape "Rectangle 1" using VBA. Yeah I added your code on it's own line just before End Sub and ws is still there too. Caption = "Drop Down" . Now i want to pass parameter to the macro which is associated with the OnAction property, string I'm trying to assign a macro to a shape via another macro. Anyone know what I am missing? Sheet1. Later, in the button 'action' routine, you can retrieve the address of the Range so that you can manipulate Feb 1, 2024 · Office VBA reference topic. With Excel 2013, the Oct 18, 2022 · To create a shape object in Excel using VBA, you must call the AddShape function. I have a shape where the parameter I want to use is stored in the AlternativeText of the shape. How to check if a cell is empty using VBA. Set myBar = CommandBars _ Jul 9, 2018 · Excel VBA: Click two buttons (shapes) that run two separate VBA scripts on spreadsheet open 3 Macro to save active Sheet as new workbook, ask user for location and remove macros from the new workbook Aug 21, 2013 · Hi, I have a little problem in my hands. Tell it which shape to begin at. Sub ONCLICK() Dim shp As Shape Set shp = Shapes(Application. I just want to get the value and the color code of the shape that the user selects by mouse clicks. OnAction macro; Posted by Bill on July 25, 2001 10:32 AM. 0. These shapes (for example, the two shown in the picture below labeled "Quality Check" and Undo Sort) use the . expression. Shapes(Selection. The AddShape function has 4 required inputs in order to generate a new shape: Type - Name of the type of shape you wish to Dec 7, 2009 · It makes a big difference if the check boxes already have a macro assigned (OnAction parameter in properties). Jan 4, 2010 · I have assigned macros to some simple shapes. List(i) . CMB. OnAction Function will do the trick. Reflection. Find a way to dynamically generate my copy routines such that I can I want to add a parameter or a reference to the button somehow. OLEFormat. I think the problem is that I put the function DeleteLine in the Userform script. Mar 31, 2011 · The Excel. A. Example. Buttons. Delete End If End With Next End Sub. Tell it which shape to end at. Controls(strMenuItem). Solution is to store details of the group, ungroup it, update the OnAction property then re-create the group. Shapes ' <-- Select the sheet(s) you need sh. Caller) '~~> This will give you the value of what is selected in that listbox This repo is no longer accepting new issues. Apr 8, 2020 · I've given up on figuring VBA's single and double quotes and acknowledge that I never needed anything to be passed as argument that wasn't available in the workbook in which the check box resides. It has one input parameter, so it can't be called directly from a Command Button. In the worksheet, I have several textboxes (shapes). OnAction = "detail" or Jul 9, 2018 · I solve the problem. Object. Mar 22, 2022 · Worksheets have hidden collections that hold pictures and ActiveX controls. OnAction value of a menu option to a Public Sub which is in ThisWorkbook or must the sub be in a module? This works: ViewTextFile() is a public sub in a module. onaction property to run a macro that is located in a standard module in the add-in. A Shape object contained by the collection. In the ONCLICK event of the forms listbox, put this. The end result I want is the shape to be assigned with 'myMacro "var1", "var2", var3"' I've selected the shape and used: MsgBox ("Parameters are: " & a & ", " b) End Sub. Row, 35) = "#VALUE!" I have buttons that are dynamically created at run-time with an onAction macro that passes 1 parameter. Jun 13, 2024 · Some properties are only available and could be tweaked using Shape object only. Caller) inside of CheckboxChange. OnAction) > 0 Then . OnAction = "'UpdateButtonAction " I found a solution for this problem. Pictures. OnAction event to an already dynamically created context sub-menu Item, I just can't for the life of me figure it out. OnAction = "'MyRoutine 15, 10'" From what I can see I have a few options: 1. I need to put three parameters in there that are variables in my original script. Dec 30, 2018 · If a Public variable is used, it will loose its value when Excel closes, even if the file is saved before closing. Range(rng). Select End Sub Sub Assign Office365 Windows 11 I have a VBA program running as an Excel Add-in which deposits multiple shapes onto the user's worksheet. If the ss variable doesn't represent a Shapes object, this example fails. To request changes, create a branch, make changes, add @lindalu-MSFT as reviewer, then submit a PR. Shapes(“OptionButton1”). Add(Type:=msoControlButton, Before:=2) With ctrls . You switched accounts on another tab or window. Functions return a value, but don't perform any actions. Type property (Excel) MsoShapeType enumeration (Office) Sub RemoveShps() Dim oShp As Shape For Each oShp In ActiveSheet. I've tried a few examples from here and other places on the web, can't seem to get them to work. Join Date 04-23-2009 Location Matrouh, Egypt MS-Off Ver Excel 2013 Posts 6,892 Is there a way to assign a macro to a shape using vba? When you add the shape, set its OnAction property to the name of the macro: Code: (Excel VBA) MrIfOnly; Nov 20, 2024; Excel Questions; Replies 8 Views 191. Ontime to run a macro at a specified time. AddItem "Create Overview . When I click on the toolbutton the function is executed, for example SYMBFUNC "4". OnAction = "DelAction()" This still won't work, since DelAction() is in your form module. Aug 21, 2017 · I know that I'm close with my . Shapes("Button Figure out what the proper syntax is in order to pass parameters to the OnAction routine. expression A variable that represents a Shape object. The code I have is the following: With ActiveSheet. by(3,6) Insert arrow_connector from center_bottom connector_node of Selected_Textbox to center_ top Jun 25, 2009 · It seems like when both a hyperlink and a macro are assigned to a shape, both are run when it is clicked. I can write . Now i want to pass parameter to the macro which is associated with the OnAction property, string param = "40" Set p = ActiveSheet. I do not know what module the macro is in. text boxes, list boxes etc), referencing Tables and Named Ranges to get values from them etc. Assign macro to a programmatically added vba button. OnAction = "'CheckboxHandle """ & . . Caller) Also, I think Parameter is a depreciated property (just like Buttons is) that may no longer be supported. onAction Sub Hello1(tag) I am inserting shapes into a sheet and I want an OnAction on each shape with a parameter (which is a variable) to call another sub. Provide details and share your research! But avoid . I am trying to pass a shape to the sub routine at on action but maybe my syntax is wrong with this onaction string?? [code] Sub test() With Sheets("Sheet1") . Insert(PictureFileName) p. Find a way to dynamically generate my copy routines such that I can deterministically set the name (w/o params) in the OnAction Excel Programming / VBA / Macros [SOLVED] [SOLVED] Buttons, onAction and . Aug 24, 2012 · VBA Powerpoint - get Parameters from Shape and hand over to another shape. Home Message Board Ask Bill Twinbox Excel Speaker Bookstore Excel Tips News Excel VBA; Pass a parameter to . With Excel 2013, the Seems VBA doesn't like setting the OnAction property for Shapes that have been grouped. Name & "!ImageRemoveClick" a) OnAction method is used to assign a macro to shape. Looks something like this. The sheet is created on the fly and creates a given You can use the . And when the box is moved, I also want to Aug 9, 2018 · 1) I read your post carefully - btw that link is not VBA-specific, but Office Interop In any case, the button you create is a Form Control type button, and as such you can't change the background color. 1. add, commandbars. Jul 29, 2011 · dim Selected_Textbox as shape dim New_Textbox as shape Selected_Textbox = ActiveSheet. To draw the connector on the left above (the curved Dec 23, 2014 · See the following simple Macro function that calculates the Cube of the input cell (as a range). Syntax. To add a connector: Add a connector shape, as you would do a line. ListCount - 1 With . This is an example of a code in production (with only the lines of interest): Dim i As Integer Set cl = MainForm. Because all parameters are necessary, also the exact position of I would have liked to comment the answer by QA Collective but I do not have enough reputation point yet. A workaround would be to create a Sub-Menu based "shape" buttons. Shapes(name1). Thus, even if Application. Set this property to the value of rCell. Trying to pass an argument with the . Each of these shapes has their OnAction routine name set to the same subroutine, and I'm successfully getting to that routine when the shape is clicked. You can assign a string to OnAction that has the sub to call followed by its arguments (note the whole string wrapped in single quotes) Like: Shape. Hi, I have been trying to get the following piece of code to work (it's part of a much larger sub from the MS KB) that calls on a function AddRemoveButton but when I perform the action I get the message "The macro cannot be found or has been disabled because of your security settings" (security is set at "low") With CBarCtl . Nov 16, 2007 · Is there a way to assign a macro to a shape using vba? When you add the shape, set its OnAction property to the name of the macro: Code: We have a great community of people providing Excel help here, but the hosting costs are enormous. Add(194, (rownr) * 12. Sub SelectCell(sht As String, rng As String) ThisWorkbook. Application. (I took a sample from a Google Search but I don't think I'm pursuing the right parameters). Nov 22, 2024 · I have a macro embedded shape ("Group 12") on my worksheet that I wish to code to disable the macro associated to it. Very handy tip. However, Macro MyMacro() which calculates the Cube of the 'Active Cell' can call the function either from within VBA code or when assigned to a shape or a command button. OnAction = "Hello1(1)" End With Set ctrls = ctrl. Hot Network Questions Formal Languages Classes Procne and Philomela as swallow and nightingale, or vice-versa? Jul 25, 2017 · I am aware that we can convert smartArts into Shapes with the Drawing Tools in Excel and then use . My subs are in the WorkBook, not in a separate module Jul 5, 2016 · In my research, I've found that there is no built in functionality for enabling double click events on Shapes on an excel sheet. The “PatchMyWorkbook” has a macro to add a button and assign an Why is this not working? Says object doesnt support this property or method. OnAction (where Dim SHP As Shape) to print the name of the macro which is assigned to a shape. Mar 10, 2016 · For a FORM control that's normal behaviour as you cannot assign a Sub depending on parameters as the button wouldn't know which parameter to hand over (for a similar reason you can't link functions to buttons), whereas an ActiveX button would create its own Sub (e. 3. Sep 12, 2021 · Office VBA reference topic. You may have already used the AutoShapes menu on the Drawing toolbar to insert a shape onto your worksheet and even experimented with the 3-D options, but what you probably don't know is that VBA gives you an enormous choice of I can also find and/or delete them by looping through the list of shapes. New posts Search forums Board Rules. Dim ss As Shape ss. OnAction = "'" & ThisWorkbook. If Cells(ActiveSheet. After all, objects such as graphs and comments are shapes. For example, I use a simple shape of Forums. Caller), "Button", vbNullString)) This (both subs in a regular module) works for me. OnAction = "'SubToCallOnAction ""Hello Basically, you need the right number of single and double quotes to pull it off. Subs perform actions on your Excel file (actions like selecting, clearing contents, changing worksheets, opening another workbook, doing calculations and many many more). OnAction with params is difficult / does not perform as expected - Stack Overflow However, now I'm struggling to make this a bit more usefull for me. Shapes(vButtonName) Apr 29, 2019 · There are a few problems here. Pick up the format of a shape in an active slide. [vba] For x = 1 to 3 wt. shapes" in excel vba 2 Excel VBA: How to add all of the current shapes on a worksheet to a ShapeRange? Aug 14, 2015 · I have 3 shapes with macros asigned to them - One Edit, you would need to remove the macro from the shape itself with . Thanks! – CaBieberach. 2. You can simply use that and access all the related properties. combo. Nov 21, 2023 · Shapes don't have events, so you can't have a class which handles them. So far I have been able to populate a controlpopup that runs a simple macro, but I would like it to be able to accept variables (aka the sheetname) to avoid having to write a bunch of different macros. OnAction property (Excel) Shape. Return value. Shapes("info_" & q_number + 1). I'm getting a bit lost on the syntax and where I need my quotes. OnAction = "detail" However, is there a way to achieve the same thing with smartArt. OnAction = "'ViewTextFile """ & strMenuItem & """'" I would like to move the sub to ThisWorkbook, so the value becomes Jul 10, 2019 · You cannot use ActiveControl for Form listboxes. The VBA also has a hidden Picture type. This Shape has a macro assigned, so I want to click it from VBA. How do I setup parameters in my code Thanks in advance for any ideas and/or suggestions! With VBA, you write the name of the macro to the OnAction-property of the shape: Dim sh As Shape For Each sh In ActiveSheet. What am I missing here? Mar 23, 2004 · I am trying to create a 3d shape with VBA on my worksheet. Controls. onaction in add-in using reference path to macro (Excel VBA) MrIfOnly; Nov Passing Multiple parameters to VBA macro from a form button WanderingSoul; Oct 31, 2024; Excel Questions; Feb 24, 2015 · I am trying to write a macro that will create a popup window that will allow me to navigate between pages of a workbook. OnAction = "mymacro" ' . I am trying to use Application. Shapes With oShp If . How odd it works for you, but for me it requests for debugging and that line is the one marked yellow. Caption = "Hello2" . Press F2 to open the Dec 12, 2013 · @Eddie I've googled and tested many codes but I can't get any of them running on shapes (On Excel2010). I would say at this moment that it's not possible to add them to shapes. Oct 10, 2013 · In this link, i use SHP. But I not able to get this working. And almost all of the Shapes, Tables and Named Ranges were referenced from the VBA code setting whether Shapes were visible and/or enabled, pulling values from Shapes (e. the line below is setting the OnAction command to call a macro named "getApplicationTab" passing the alternativetext as a paramater. I need it to be 'dynamic' in the meaning that I have a loop and the parameters are to be used in de OnAction. Controls("classroomList") For i = 0 To cl. Say you have two Workbooks one called “MyWorkbook” and the other called “PatchMyWorkbook”. It adds the picture but fails before assigning the macro. To do it in Excel, here is the answer: Description: a) OnAction method is used to assign a macro to shape. Then it works. Do I need to set up the OnAction property to tell it to expect parameters B. Testing empty cells in excel vba. Apr 7, 2014 · This is the XML fragment I have in my Excel Workbook, It displays correctly in my ribbon, custom icons and text, but when I click on the icon I can't get the Sub "OpenSettings" running. Caller property. We are trying to automate our process with VBA but we have a roadblock in triggering the "CREATE SAP JOB RUN LIST" macro. Caller 'Set variable to active shape Set objActiveShape = ActiveSheet. Caller property (Excel). Shapes("Edit_Button"). Finally, reroute the connections (this basically makes sure that the connector is where it should be on screen, given the current position of the two shapes it's linking together). I'm passing the input as Public Function cross_sum(myRange As Range) As Integer to them so that they take cell references as input, e. 2) How can I shade I can write . Sep 25, 2012 · Passing the Shape name as parameter for the . expression A variable that represents a CommandBars object. Many of the workarounds I saw involved writing classes or other such things to add this functionality, all of which seemed a bit beyond my VBA knowledgebase. TopLeftCell. I created this simple macro for this purpose, and I created a button in my quick-access-toolbar to run it on selecte shapes, it works just great. Parameter = name 'this does not work End With now in this mymacro i have the shapes. . The first macro below assigns the Shape_Click macro to all the shapes on the active sheet. Assign/run macro code from a button without the need for a separate macro in Excel VBA. controls. ActionControl. Caller property to get the name of the shape which fired the macro. Checkbox control has the property LinkedCell. My problem is that in that OnAction routine, I can't figure out how to determine which shape was clicked. 2) How can I shade alternate rows in color using VBA to make it easier to read voluminous data running into hundreds of rows? 3) How to delete rows with Excel VBA Hello All, I want to write some generalized code to handle custom menu item clicks. To get the button pressed as a shape ActiveSheet. OnAction = ActiveWorkbook. Shapes(Application. I have a macro that identifies a Shape amongst a collection by its caption; so I can select it, move it, etc. Individual Dec 12, 2012 · events - Excel VBA CommandBar. Jul 25, 2001 · Pass a parameter to . 25, 11. Run your code as is and try to change the color manually - Dec 28, 2024 · Private Sub opt_InsertNewTask_Click() 'assign Procedure to a Shape Dim objActiveShape As Shape Dim vButtonName 'Get shape name the user just clicked on, convert it to its Row #, Insert new Row (for New Task) vButtonName = Application. Pictures have a CopyPicture method that is more consistent then `Shape. We just have to tell the shape to run the SelectCell macro with our desired parameters (Sheet name, and cell address). CheckboxHandle "chk123":. I use . Now I am having problem of locating which one I have clicked since I need to modify the attributes of the clicked shape after clicking on that shape. Previous solutions did not work for me, as my macros are in named modules in my VBA project. onAction on them like: ActiveSheet. Width = 100 . AlternativeText to store strings with shapes (forms controls are shapes) Try, in test(), MeetingId = Trim(Replace(Application. nodes using VBA? Say I have a node called "nodes1" I have tried: nodes1. Name) New_Textbox = (parameters for new textbox size) When macro_pressed Insert New_textbox below Selected_Textbox offset. May 6, 2024 · Shape. AddPicture you can enable a link to the source file. OnAction = Jun 25, 2015 · I'm writing some VBA functions in Excel that compute word values and cross sums of the input. Reload to refresh your session. =cross_sum(A1) . Either move the function to a public module, with parameters, or hardcoding the object names there, Jul 2, 2019 · How to insert shape into specified cell using "for each shape in activesheet. Commented Oct 1, 2012 at 7:44. With Activesheet shape. You can find similar Excel Questions and Answer hereunder 1) How do i put double quotes in a string in vba in Excel. Read/write String. Hot Network Questions It makes a big difference if the check boxes already have a macro assigned (OnAction parameter in properties). I am having difficulty assigning the 3d properties. Button click find empty cell. OnAction = "'SymbFunc """ & SymbolNr + 1 & """'" Where SymbolNr is a counter. You could try to pass the name of the checkBox instead. OnAction procedure for each added button but the only thing that has to be done is putting a value in the activecell. add) I don't know which command to use and why. add, oleobjects. Jul 18, 2020 · I'm trying to do something very simple in Excel using VBA. Remarks. OnAction = "Hello1(2)" End With End Sub. OnAction = "HelloWorld" ' <-- Change this to the name of your event procedure Next If you want to know which shape was clicked, you can use the Application. AddTextbox(msoTextOrientationHorizontal, ColWidth + 5, z* 11. Size to indicate if Oct 16, 2018 · On worksheet "Main" there is a RectangleRoundedCorners shape which has the macro assigned ("CREATE SAP JOB RUN LIST"). CommandBars("Shapes") looks like a built in feature of VBA, it doesn't trigger anything. Excel VBA to trigger a macro assigned to a shape click. Make some form check boxes on a sheet Copy this code into a module (alt F11, insert, module) run SetMacro Save and test Jul 9, 2018 · I would have liked to comment the answer by QA Collective but I do not have enough reputation point yet. OnAction property, but I'm unsure on the code to apply it to the shape. Address or the like. Shapes have an OnAction property which is the name of a macro which is run when a shape is clicked. To get the name of the Form listbox which called the ONCLICK event, use Application. OnAction. Name & "'!" use "Assign Macro " to define a macro to each shape which fires on "Click" You can use the same macro for each shape and use the Application. Before you ask, I can't just call the macro normally since down the line I need to use Application. Basically I want some code to be tiggering by changing (deleting) a shape! I do not know why the deleting of a shape is not triggering the Worksheet_Change event - can somebody help me with this? Currently I do not even get the first messagebox when I click on the delete button of my Jan 23, 2017 · You can dynamically add a button Shape to a Worksheet and fit it to the cell dimensions and then further add an action to that button. At the time of creating the button you can add an AlternativeText to the button with the address of the Range it is fitted into. It is possible through VBA to create a hyperlink with no destination address. The code runs fine and inserts the OnAction: Hi, I have a shape in my worksheet and I have defined onAction property to it. OnAction syntax but whether it's because I'm mis-using my Sub / Function with parameter call events, or because I'm also trying to dynamically assign the . onaction see attached By nwb in forum Excel Programming / VBA / Macros Replies: 4 Last Post: 05-13-2013, 04:41 PM. Private Sub CommandButton1_Click()) within the code space of the worksheet it appears. I have a really weird one with a Shape that has it's onaction set to a macro. For example, if one has a shape where the Reflection is set to msoReflectionTypeNone, one could use the . Add(Type:=msoControlButton) . Check if cell not empty. By usage of the function Shapes. Set OnAction to the CheckboxChange macro. So I'm saying you can test whether or not your userform is loaded when the click event occurs. OnAction event. I know I have to use the Shape. The text name of the object is the value of the Name property. What I find odd is that the Shape class doesn't have a click event (AFAIK) yet a shape added from the shapes menu on the ribbon does. Then you have all the ingredients to write an intelligent handler - like a (hidden) Excel table that resolves shape name into an URL, text or whatever The OnAction-property is a string holding the name of a Sub (plus parameter). group 12. faceId = 177 . Therefore I can easily get all the information I might want to pass directly from the worksheet. To get the clicked checkbox, use Evaluate(Application. Excel Help; Solved: Shapes OnAction; I created some shapes so that OnAction, a macro is run. Replace your two lines setting the TextFrame and OnAction of the oShape object with the following: Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. Nov You signed in with another tab or window. onaction = "" End With The line in Jul 25, 2016 · Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. To solve this, I put the function in the script of sheet 1, and for onaction parameter of the button, I use onaction = "sheet1. Setting this property for a menu item overrides any custom help information set up for the menu item with the information set up for the assigned macro. To pass the parameters of your specified cell to the shape add the following code: (I am assuming that ActWS is your active worksheet) Adding a connector. You signed out in another tab or window. Dec 23, 2017 · I am currently having a problem with my excel vba script. Here's some code to assign an OnAction if the checkboxes don't have one. Testing for NULL. shape object in PPT from excel. onAction I created some shapes so that OnAction, a macro is run. Caption = cl. Aug 6, 2024 · A large number of the Shapes triggered VBA code via their OnAction property. One way to preserve the Enabled status of a shape would be to use a hidden property of the shape as an indicator. Absolutely no code is stored in the This runs without errors but what I can't seem to get working is the Selection. DeleteLine". So when I click the delete button on the sheet, it cannot find the function. Sheets(sht). Caller, which doesn't work unless, well, there is a caller Oct 7, 2024 · Sub Shape_Type_FormControlType() ‘returns 12 indicating an OLE control object (MsoShapeType constant of msoOLEControlObject) MsgBox Sheets(“Sheet1”). 25) About to lose the plot here! Already have a spreadsheet that when the user clicks on a certain choice (via a shape with a hardcoded macro) a further shape is assigned another using text it picks up from a cell elsewhere. OnAction = DelAction() This will call the function, as you have seen. wxtfe jyavx vaapl frfiy friud tjtf jcwvx afau motlpnc oude