Problem Analysis:Excel2007 the previous format is. xls, after which the format is. Xlxs. Open a separate Excel document and use the Save As feature to easily convert the format. But the face of hundreds of Excel tables so tired, search for a long time, also did not find a tool can be directly batch format conversion.Finally, you can use VBA to implement the ability to convert the Excel format in bulk. Do not be frightened,
Programming below is VB to open the file code:
If Dir ("D:\excel.bz") = "Then" Determines whether Excel is open
Set xlapp = CreateObject ("Excel.Application") ' Create Excel application class
xlapp.visible = True ' Set Excel visible
Set xlbook = XlApp.Workbooks.Open ("D:\test.xls") Open Excel workbook
Set xlsheet = xlbook.worksheets (1) ' Opens Excel worksheet
Activeworkbook.save
Xlapp.displayalerts = False
xlapp.screenupdating = True
xlApp.Quit
End If
Then open the Excel worksheet,
must be included. If the data type is missing during the declaration, the variable is automatically declared as variant.Dim X as integer, y as integer, Z as integerIn the following statements, both X and Y are specified as the variant data type, and only Z is specified as the string data type.Dim X, Y as integer, Z as stringIf an array variable is declared, parentheses must be included, but the lower mark is optional. The following statement defines a dynamic array myarray.Dim myarray ()
11.3
In Excel, there is no conversion between simplified and traditional text.
But word has this feature, so we can call the traditional and simplified features of Word in Excel by using VBA code to realize the functionality of simplified traditional translation in Excel.
Here is the VBA code associated with this, and I h
Method 1: Use VBA's original properties, methods, and worksheet functions as much as possible
Because the Excel object is up to odd, the object's properties, methods, and events are numerous and may not be fully understood by beginners, which results in a code snippet that programmers often write about the same functions as the properties and methods of Excel objects. The efficiency of these snippets is obviously different from the properties of the Excel object, and how quickly the method acco
VBA language basics
Id 1I. DefinitionAn identifier is a symbol that identifies the unit of a variable, constant, process, function, class, and other languages. It can be used to reference variables, constants, processes, functions, and classes.Ii. Naming rules1) It is a combination of letters, numbers, and underscores (_), such as a987b_23abc.2) The character length is less than 40 (excel2002 and later Chinese versions, can use Chinese characters an
Basic understanding of VBA language created by Vietdung90, last modified 2016-10-18 "go from W3cschool" first section: IdentifiersFirst, the definitionAn identifier is a symbol that identifies variables, constants, procedures, functions, classes, and other language constituent units that can be used to reference variables, constants, procedures, functions, classes, and so on.Second, naming rules(1) The beginning of the letter, consisting of letters, n
' VBA object' The objects in VBA are actually the objects that we manipulate that are supported in Excel with methods and properties' Several common object representation methods in Excel' 1, workbooks' Workbooks represents the workbook collection, all workbooks, Workbooks (n), which represents the nth workbook that has been opened' Workbooks ("Workbook name")' ActiveWorkbook the workbook that is being mani
Transferred from
Http://www.cnblogs.com/wangminbai/archive/2008/02/22/1077203.html
We all know that pointers can be used in C, but now VB (of course there are VBA) can also be used as pointers. This is an article I have read on the internet for your reference.Think that the East is undefeated, black Cliff secret room battle, only with a embroidery needle fight four Masters alone, no ghost, called the world's first martial arts. If you want to become a
features include:1. compatible with VBA syntax2. Similar to ASP embedded script syntax, and supports 3. Supports functions and process definitions, and adds IIF functions and App objects.4. Access the structure information of the current database through the Schema and Table objects passed in by the software
In fact, CodeDG does not automatically generate code. It is mainly a platform for Retrieving Database structure information and parsing and exec
First, the premise condition
In the Excel cell, you have entered the person's name, and, under the name, leave a blank cell to insert the appropriate picture.
Like the following figure. For example, B1 is the name, and B3 will automatically insert John's photo into B3 according to John's name. others, etc.
This has to be done using VBA.
At the same time, the person's photo is located in the folder, and Excel works thin, in the same pat
To Create a VBA projectTo create a VBA project node:1. Expand the "Project Library"-"Utilities" node, right-click on "VBA Projects" and select "VBA project" in its right-click menu.2. Enter the name of the node in the program that pops up.Note: 1) name in English;2) Multiple nodes do not use similar names (such as: VBA
From the previous article "Python Excel operations", we can see that python Excel operations are very convenient. However, Python and related libraries are an additional dependency. If you can solve such problems from Excel itself, it is naturally easier to use.
1. In VBA, the focus of the hash table in python is that the Vlookup formula is too slow, so the key is to find a more efficient algorithm or data structure to locate the data. Vlookup require
1. VBA object
Almost 90% of VBA programs operate on objects. VBA has corresponding objects, attributes, methods, and events. objects are the core
A) how to operate objects
Object. attribute, object. method, parent object. Sub-object. Attribute
For example, sheets ("worksheet"). Name ---- sheets ("worksheet") is an object, and name is an object attribute.
Workbook
VBA run-time error 1004 how to troubleshoot
In the Excel software, some users use VBA, in some tests, occasionally encounter software error prompts, such as Error 1004. This is usually the result of an error that VBA runs, so how does the VBA runtime error 1004 solve it? The next small series tells you what to do with
Access Enthusiasts are proud of VBA. I think this is not a good phenomenon. VBA is only a subset of VB, there are many limitations, such as not support inheritance, not support pointers, do not support child type, etc. Using VBA to manipulate data structures outside of the Office family is very difficult. VBA is just a
Worksheet class and object of Excel VBA Project
1. worksheet classes and objects when creating a workbook:
1. Create classes and objects:
2. Class and object names:
2. Modify codename:
1. codename is read-only during running, that is, during running, you cannot use code to change this attribute of the worksheet. You can only read this attribute. Otherwise, an error dialog box is displayed as follows.
2. synchronous modification:
[1] codename can be
From: http://blogs.msdn.com/ B /vsod/archive/2009/10/02/excel-how-to-run-c-code-behind-with-a-click-of-a-button-on-a-worksheet-without-vba-code.aspx
Excel: How to Run C # code behind with a click of a button on a worksheet, without VBA codemsdnarchive
2 Oct 2009 pm
0
OLE object controls such as command button, checkbox, Etc ., allow us to call VBA code behi
VB, VBA, VBS exactly what is different. You need to learn VB before learning VBA.Of course not. Before you learn VBA, you don't need to learn VB.Instead of VB based people learn more simple VBA, the concept will be compared ChuProgrammers who already know VB need a considerable amount of time to transition to VBA (othe
The VBA code contains variables, operators, and statements. Variables play a role in the code to cross and join. Variables are created as appropriate to the object and data type, to initialization, and then the operator to calculate or execute the statement modification, to complete the process of mutual exchange.
The key word for declaring a variable is dim, whose syntax is
Dim [WithEvents] varname[([sub
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.