vb Select the Excel workbook you want

Updated on technology 2024-06-15
11 answers
  1. Anonymous users2024-02-11

    Due to the incompleteness, I tried your problem with my own project. Substitute for yourself.

    The main reason is that there are a lot of windows under the application, so it cannot be activated directly, and the windows index (such as ** under command2) must be specified after obtaining the application

    True is also important.

    It can be activated by activating the workbook (e.g. ** under command1), which is recommended.

    I can do both of these methods after debugging.

    private sub command1_click()dim wb as

    set wb = getobject("d:\")= true

    end sub

    private sub command2_click()dim wb as

    trueend sub

  2. Anonymous users2024-02-10

    set xlsheet =

    1) =1111 'The sail bridge assigns a value to the monomorphic friend of the fierce grid (row, col).

    a = , 1)

    e: Work report line. xls"

  3. Anonymous users2024-02-09

    Right-click on the label of the table and return to the selection"View**", the "Microsoft Visual Basic for Applicaions" window will open, all tables will appear on the left, double-click any table, and the right side will be dry. If you want to go back to the table, select the table in the list of tables on the left, and then right-click "View Object", and the pure world cave will return to the selected table.

    good lockļ¼

  4. Anonymous users2024-02-08

    dim h1, h2, l1, l2

    h1 = 5: h2 = 8 'The first and last line numbers of the selected line.

    l1 = c": l2 = e" 'The number of the first and last columns of the selection.

    ge = l1 + trim(h1) +l2 + trim(h2)range(ge).select

  5. Anonymous users2024-02-07

    l1, l2, h1, h2 are the variables that represent the row number and column number. Isn't it a requirement to "select a region in an excel sheet in VB language"? , this is VB's **!

  6. Anonymous users2024-02-06

    Add as a reference, as follows:

    Create a workbook object.

    dim workbook as workbook = new workbook()

    Load the excel document.

    Get the second worksheet.

    dim sheet as worksheet =

  7. Anonymous users2024-02-05

    The VB language in Excel is called VBA, and you can use ** to create a new one in VBE.

    Excel version reference: 2010

    Demo: Create a worksheet named test.

    1. Alt+F11 to enter the VBE window.

    2. Right-click the worksheet tab-insert-module.

    3. Enter **:

    sub test()

    sheets( = "test"

    end sub

    4. Press F5 to view the worksheet, and the newly created test table has been created.

  8. Anonymous users2024-02-04

    You can use :set xlsheet=

    You can then use xlsheet to manipulate the new table.

  9. Anonymous users2024-02-03

    1) Copy the following paragraph into the module of the personal macro workbook and prepare to call sub movesheets().

    dim w as workbook, ws as workbook, sht as worksheet, i as integer

    set w = workbooks("The name of the source file")set ws = workbooks("The name of the target file")for each sht in

    i =after:=

    nextend sub

    2) Open these two files and execute the macro again.

  10. Anonymous users2024-02-02

    The name of the worksheet is processed on the line, do not duplicate the name of the 2nd workbook, and the name of the workbook to be copied is the workbook.

    The name of the workbook copied to the workbook.

    sub macro 1().

    dim i, s

    with workbooks("Workbooks")for i = . to 1 step -1s = .sheets(i).name

    sheets(i).name = "Workbook 1" & ss = .sheets(i).name

    sheets(i).copy before:=workbooks("Workbooks").sheets(1)

    nextend with

    Do not save Close Workbook 1

    workbooks("Workbooks").close falseend sub

  11. Anonymous users2024-02-01

    It's not in VB language, it's VBA language, copy with copy method, paste with paste method. How to paste it and go to the help to check.

Related questions
9 answers2024-06-15

Referencing the Microsoft Excel Type Library in the project: >>>More

3 answers2024-06-15

Your first one is not a loop statement.

private sub form_click()if i = 0 then >>>More

13 answers2024-06-15

Test OK, including "1, oxalic acid", etc.; Numbers and numbers are lined up together, letters are lined up with letters, and kanji and kanji are lined up together. ** Below: >>>More

8 answers2024-06-15

It is recommended to go to excelhome to ask, and you can put the example on which forum to try >>>More

8 answers2024-06-15

excel2007 freeze window - horizontal freeze a line method: >>>More