Jul 01 2022 01:30 PM
Hello,
I'm hoping someone can help.
I'm looking to place forms control buttons, that when clicked, will take the viewer to an area of a worksheet.
For example: I have a large report that I send to my branch managers listing their safe deposit box inventories. These lists have multiple box sizes and to view this data scrolling has to take place to find them, which is cumbersome and time consuming.
I'm looking to place buttons at the top of the worksheet that read the box sizes (i.e. 3x5, 3x10, etc.) and when clicked the curser will move to the cell with the title of the box size.
I've tried to search this here and on YouTube but can't seem to find how to code the buttons, nor could I figure it out by reviewing the "Format Control" menu within the control button.
Could someone let me know if this can be accomplished and how to do this?
I appreciate any help you can lend.
Jul 01 2022 09:36 PM
Here are three small VBA examples that you can use, depending on what you intend to do.
‘ 1. Button with VBA & Hyperlink:
Private Sub CommandButton1_Click()
ActiveWorkbook.FollowHyperlink Address:="https://www.Nikolino.de", NewWindow:=True
End Sub
‘ 2. Button with VBA form control
Sub ButtonClick ()
Worksheets("Sheet1").Select
End Sub
‘ 3. Button with VBA Active X control
Private Sub CommandButton1_Click()
Application.Goto Sheets("Sheet1").Range("C25")
End Sub
As a VBA alternative, formatting a cell to look like a button and then pasting the hyperlink into the cell would be the most elegant solution and save resources. But that also depends on your plans.
Hope I was able to help you :).
I know I don't know anything (Socrates)
Was the answer useful? Mark them as helpful!
This will help all forum participants.
Jul 21 2022 07:51 AM
Jul 21 2022 08:36 AM
Jul 21 2022 08:39 AM
Jul 22 2022 12:58 AM
Jul 22 2022 05:20 AM
Jul 24 2022 04:41 AM
This works for me, with simple controls and with active X controls.
If the examples in this file do not work for you either, I recommend that you insert a file (without sensitive data).
You could also send this to me as a private message.
Aug 09 2022 10:54 AM
Thank you for your response. I've attached a file of one of our branches and excluded account numbers and member names. I've also placed in cells the box sizes (not as buttons, only as text within the cell) for rerferrence as to what buttons I need for this location.
Aug 09 2022 10:53 PM
Here is your file with the buttons.
I took the liberty of putting you in different types of buttons (with ActiveX control, without, hyperlink, image) so you can choose what type of button you want to add.
Furthermore, I wish you much success with Excel.
Carpe diem
So di non sapere niente (Socrate)
Aug 10 2022 10:12 AM