-
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
-
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"
-
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ļ¼
-
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
-
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 **!
-
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 =
-
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.
-
You can use :set xlsheet=
You can then use xlsheet to manipulate the new table.
-
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.
-
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
-
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.
Referencing the Microsoft Excel Type Library in the project: >>>More
Your first one is not a loop statement.
private sub form_click()if i = 0 then >>>More
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
It is recommended to go to excelhome to ask, and you can put the example on which forum to try >>>More
excel2007 freeze window - horizontal freeze a line method: >>>More