简体   繁体   中英

How to open a spreadsheet in Excel?

How can I make that, when pressing the command button, it opens the first spreadsheet of Excel?

I am coding in Visual Basic Forms in Excel 2016. This is my code:

Private Sub OptionButton1_Click()
If OptionButton1.Value = True Then MsgBox (" Has decidido Actualizar el Inventario")

Workbook("Hoja1").ShowAllData
End Sub

The code can be simplified into this:

Sub firstSheet()

Sheets(1).Select

End Sub

Then go to the Developer tab, add a button, and assign it to this macro.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM