ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Simple use of ActiveX Command Button - (https://www.excelbanter.com/excel-programming/396123-simple-use-activex-command-button.html)

Dave K

Simple use of ActiveX Command Button -
 
Hello,
I am trying to use an activeX button to link to select a specific cell
within another sheet within the same workbook. That is, with the
Command button in Worksheet1, I want users to click it and be linked
to Cell B40 in Worksheet5.

Could you please let me know the basic code (that I will place in the
macro) that would achieve this?

Also, keeping in mind that I am new to using VBA, could you provide
step-by-step instructions for inserting the code?

Thanks!


p45cal[_50_]

Simple use of ActiveX Command Button -
 
Drag a button off the Controls Toolbox toolbar. Doubleclick it. A new window
opens, so where the cursor is sitting paste the following:


Worksheets("Sheet5").Activate
Worksheets("Sheet5").Range("B40").Select

Close the newly opened window (no need to save). On the sheet, unclick the
Design icon on the Control Toolbox, to take it out of Design Mode and try
clicking the button. If it works, save the file which saves the new code.

--
p45cal


"Dave K" wrote:

Hello,
I am trying to use an activeX button to link to select a specific cell
within another sheet within the same workbook. That is, with the
Command button in Worksheet1, I want users to click it and be linked
to Cell B40 in Worksheet5.

Could you please let me know the basic code (that I will place in the
macro) that would achieve this?

Also, keeping in mind that I am new to using VBA, could you provide
step-by-step instructions for inserting the code?

Thanks!




All times are GMT +1. The time now is 01:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com