Excel VBA implementation returns the previous worksheet page

Updated on technology 2024-05-02
14 answers
  1. Anonymous users2024-02-08

    OK. 1. Set a public variable to store the current worksheet name public shname as string.

    2. Use the workbook open+workbook sheetdeactivate event to write shname, and write the worksheet name to snname

    3. Back button, only needed.

    worksheets(snname).select on the line. ** and structural design.

    See the attachment for details!

  2. Anonymous users2024-02-07

    You don't have to do anything, Excel has this feature by itself.

    In the file that command. The bottom 1... This is the latest file you opened,2... It's the last file you opened, 3... 4.。。And so on.

  3. Anonymous users2024-02-06

    sub returns to the original worksheet ().

    with sheets( 'Use.

    Replaces the current worksheet.

    '''''''''If the worksheet named "temp" does not exist, create an ON Error Resume Next'Ignore the trap error below with sheets("temp")

    if <>0 then 'The specified worksheet does not exist ="temp"

    The new table you add is automatically activated as the current table.

    end if

    end with

    select ''''''Activation returns ""Legacy worksheet for msgbox"The original worksheet has been returned"

    end with

    end sub

    Try.

  4. Anonymous users2024-02-05

    You need to load a toolbar and add the most recent one to it.

  5. Anonymous users2024-02-04

    with sheets( 'Use. Replaces the current worksheet.

    ''''''''''''''''''''''If the temp table does not exist, create a new one''''''''''''''''''''''

    on error resume next 'Ignore the trap errors below.

    with sheets("temp")

    if <>0 then 'The specified worksheet does not exist =

    temp" 'The new table you add is automatically activated as the current table.

    end if

    end with

    select ''''''Activation returns ""The original worksheet is operating.

    Do what you have to do.

    end with a try.

  6. Anonymous users2024-02-03

    Take a look at your original worksheet, adding a new worksheet will not change the current active worksheet.

  7. Anonymous users2024-02-02

    Before adding a new sheet, record the current table, like **sub run().

    dim obj as worksheet

    set obj = activesheet'Record the original sheet'Add a new sheet

    1) = "Operation"'Perform operations on the original sheet set obj = nothing

    end sub

  8. Anonymous users2024-02-01

    In the deactivate event of the worksheet, the program can remember the name of the current sheet (it can be recorded in a cell).

  9. Anonymous users2024-01-31

    Just use a hyperlink.

  10. Anonymous users2024-01-30

    The simple way to do this is to draw a button, paste it into each worksheet, and add a hyperlink to the Excel home page you said.

  11. Anonymous users2024-01-29

    sub returnit()

    sheets("Home page interface").activeend sub

    Then you add a control.

    sub comb_click()

    call retrunit

    end sub

  12. Anonymous users2024-01-28

    public sub addbutton()dim i as integer

    dim n as integer

    dim sheetname as stringn =

    for i = 1 to n

    sheetname =

    if sheetname <>"Home page interface" thencall worksheets(sheetname ).="", link:=false , displayasicon:

    false, left:=, top:=, width:, height _

    end if

    nextend sub

    Then add the following statement to each page.

    private sub commandbutton1_click()worksheets("Home page interface").activateend sub

  13. Anonymous users2024-01-27

    I add a button to the no page, button **:

    private sub commandbutton1_click()worksheets("Home page interface").activateend sub

  14. Anonymous users2024-01-26

    1. As below screenshot shown, I want to place each workbook name from the first chapter on my desktop into a worksheet.

    2. Create a new workbook, name it "Chapter 1 Table of Contents", and press Alt+F11 to open the macro interface.

    3. In VBA, click the insert button, click the module under the insert menu, you can create a new module, the system defaults to module 1, of course, you can also rename it as needed.

    4. Use the do loop statement and enter ** as shown in the following figure in VBA

    5. Go back to the workbook named "Chapter 1 Table of Contents" and press Alt+F8 to pop up the macro dialog box.

    6. Click the execute button in the macro dialog box, the macro dialog box will be automatically closed, and the name of each folder in the first chapter will be displayed in sheet sheet1. Finally, adjust the format according to your needs.

Related questions
20 answers2024-05-02

Don't be like that, you have to know that the marriage of two people is not easy. It's impossible to fall in love with someone for 2 days, and even if it is, it's not deep, stay away from him, don't see each other again. He said that he would not give up his wife, you will not have results at all, so why should you pursue things that have no results? >>>More

16 answers2024-05-02

Because you have loved, you will not become an enemy; Because I have been hurt, I won't be friends; It can only be the most familiar strangers. Love has been known, drunk has been drunk. The memories of love should be well collected, but the happiness in the future should be found separately. >>>More

19 answers2024-05-02

If there is no repetition after the plan + unit + keyword is connected, then you can use the array function, enter in j2 and then hold down the ctrl+shift key, and then press enter, the result is as follows:

8 answers2024-05-02

I have him in my heart, for example, I will miss him when I can't see him, I will feel happy and happy when I am with him, and I will worry about him when I know that he is in trouble. >>>More

22 answers2024-05-02

People who are attracted at first sight really can't just go with the flow. So I will deliberately create a chance encounter, and I will think that he likes me affectionately, and it was okay at first, but if I don't get a reply after a long time, I will start to be very sensitive, and I can cry when I see my back, which is very painful. Before I met him, how could I imagine that I would like someone so much, and I like to feel the piercing pain of my heart, and live in the one-man show I made up for myself. >>>More