Macros run through the creation of a button

Riico_11

New Member
Joined
Apr 2, 2013
Messages
3
I am very new to excel and I have been asked to create a very basic macro through the use of buttons.

I have 2 sheets in my workbook. I basically need to create a button on sheet 2 that will hide columns in sheet 1. I need this button to also prompt the user to click on button 2 to unhide the columns </SPAN>when they are finished imputting their data.

Some guidance here would be greatly appreciated, creating the macro itself seems easy enough using record macro but I am having trouble with linking it to a button on a seperate sheet.

Thanks!
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
you need 2 buttons one to hide and the other to unhide back to original data
so 2 macros are required. you can RECORD the teo macros and tweAK.

once the macaros are ready names be;ng test1,test2 then create two form buttons and assign these macros to the two buttons respectively

if any other doubt post back
 
Upvote 0
I am able to do this part effectively. The two areas I am having trouble are:

I have the buttons located on sheet2 and when I run the macro using the button it run on sheet2 but I need it to run on sheet1. I would like to keep the buttons on sheet2.

The other part is adding a prompt to the button itself.

Thanks!
 
Upvote 0
inthe beginning of the macro put a statement

worksheets("sheet1").activate

in thatcase macro will run only on data of sheet1 wherever button is

later whenyou become more conversant with wriring macro you can use WITH function.

when you assign the macro you can JUST CLICK the ;button to run the macro

later instaead of a command button you canuse check box so that oe button is enough for both macros.
 
Upvote 0

Forum statistics

Threads
1,213,510
Messages
6,114,044
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top