Share via

Button function in excel 2010

Anonymous
2018-08-09T09:53:23+00:00

Hi!

I'm working on a project and i need some help with buttons.

I need a button that when clicked, introduce text in a cell. Something like this click button 1 -> in cell G6 in sheet 2 appears the text "Ricardo".

Can please somebody tell me how to do it or some info source?

Tia

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. HansV 462.6K Reputation points
    2018-08-09T10:29:20+00:00

    Activate the Developer tab of the ribbon.

    (If you don't see it: select File > Options > Customize Ribbon. Tick the check box labeled Developer in the list of Main Tabs on the right, then click OK)

    Click on Insert in the Controls group of the Developer tab of the ribbon.

    Click on Command Button under Form Controls.

    Click on the worksheet where you want to insert the button. Excel will display the Assign Macro dialog.

    Type a new name for the macro, or leave it as proposed by Excel, then click New.

    Excel will activate the Visual Basic Editor, and show the first and last line of the macro:

    Make it look like this:

    Sub Button2_Click()

        Worksheets("Sheet2").Range("G6").Value = "Ricardo"

    End Sub

    Switch back to Excel and save the workbook as a macro-enabled workbook (.xlsm)

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments