Tag Archives: button

Excel Macro Button

Questions: Is there a way to create a button in Excel to trigger a Macro. So say I have a button that says “Start” that I can click to start a Macro instead of using a hotkey. Answers: Go into the VBA IDE (by clicking to edit your macro or similar). On the left hand… Read More »

VBA Code to hide cell values using Button

Questions: I am currently using a VBA code that is : Sub PasswordPointage() Dim Password As String Do Until Password = “123” Password = InputBox(“plz enter password”,”Password”,””) If Password = “” Then Exit Sub End If Loop Columns (“A:B”).EntieColumn.Hidden = False End Sub But the Problem is that I can’t protect my sheet and make… Read More »

Is there a way to edit caption on Form Control buttons?

Questions: Is it possible (on a sheet change event), to change the caption text of a Form Control button? Ideally, I would like to add a variable into the existing button caption depending on other data in the workbook. Answers: Well, right click the Sheet1 tab on the bottom of spreadsheet and select view code… Read More »

ASP.NET Excel file download on button click

Questions: To preface, all of this occurs on a local intranet, which does not at any point need to connect to the internet. I have a database on which I run a query, after which the user presses a “Download Spreadsheet” button which creates/sends the spreadsheet. The creation of the spreadsheet works fine, but after… Read More »

Spurious change in code name of ActiveX control command button

Questions: Not a duplicate because the issue described here happens despite having deleted the *.exd files as suggested in the answer to Excel renaming Activex Controls on other computers and elsewhere. One particular machine on our network (let’s call it “Computer 2”) spuriously and silently changes the code name of ActiveX command buttons placed in… Read More »

How to Add Icon to a Excel Menu/Toolbar Button

Questions: I need to add a image to a custom toolbar/menu item which is create through VBA. For a toolbar item, I tried following code Set NewBtn = TBar.Controls.Add(Type:=msoControlButton) With NewBtn .Picture = LoadPicture(“mypic.bmp”) .OnAction = “‘MyFunction””” & para1 & “””‘” //VBA Function ‘.Caption = “MyFunction” .TooltipText = “MyFunction” .Style = msoButtonCaption End With In… Read More »