question

SolimanMohamed-5768 avatar image
0 Votes"
SolimanMohamed-5768 asked cooldadtx commented

How to move between sheets in Excel using Office Script

Hi,
I used to use VBA to create a button to help users move from a sheet to another sheet in the same workbook. How can I do the same using Office Script?

office-scripts-excel-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

cooldadtx avatar image
0 Votes"
cooldadtx answered cooldadtx commented

I'm not too familiar with the Office Script API but my understanding is it is similar to the old VBA model. So given a worksheet (which you can get from the workbook) you should just need to call Activate) on it. The link has an example of how you might use it.

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for your reply. However, it doesn't move the user to the sheet.
I have 2 sheets ( Sh1 and Sh2). I want to have a button on each sheet, so when the user clicks it will go to the other sheet. I used to do that easily in VBA, is it possible to do the same using Office Script?

0 Votes 0 ·
cooldadtx avatar image cooldadtx SolimanMohamed-5768 ·

Please post your script so we can see it.

0 Votes 0 ·

Sub GotoSh2()
' GotoSh2 Macro
Sheets("Sheet1").Select
Range("A1").Select
End Sub

Sub GotoSh1()
' GotoSh1 Macro
Sheets("Sheet2").Select
Range("A1").Select
End Sub

0 Votes 0 ·
Show more comments