Properties' VBA properties are features of VBA objects' means that a property of an object is represented by theObject.Properties= property valueSub TTT ()Range ("A1"). Value = 100End SubSub TTT1 ()Sheets (1). Name = "Worksheet renamed"End SubSub Ttt2 ()Sheets ("Sheet2"). Range ("A1"). Value = "ABCD" End SubSub Ttt3 ()Range ("A2"). Interior.ColorIndex = 3End Sub3. VBA
on the unit price, when there are a large number of Model Materials and many orders, and quotations are constantly updated, the reconciliation at the end of the month still requires a lot of manpower. considering this, I think of a simple reconciliation system.
This reconciliation system is very simple, that is, first create a table to enter the supplier's quote in the order of recent and distant in the Excel table, take the table name as the quote, and then create another table
0
Application forced return: The application has been suspended until the user responds to the message box to continue working
Vbsystemmodal
4096
System forced return: All applications are suspended until the user responds to the message box to continue working
vbMsgBoxHelpButton
16384
Add the Help button to the message box
vbMsgBoxSetForeground
65536
Specify a message box window as a foreground window
statements, in addition to judging statements, there are circular statements, there are several forms:
1, while ... Wend statement. Grammar:
While condition
[Statements]
Wend
While ... The syntax for a Wend statement has the following sections:
Partial description
Condition necessary parameters. A numeric expression or string expression that evaluates to TRUE or False. If condition is Null, condition
First, Select case syntax and parameter introduction
Select Case testexpression
[Case Expressionlist-n
[Statements-n]] ...
[Case Else
[Elsestatements]]
End Select
The syntax for the Select case statement has the following sections:
testexpression necessary parameters. Any numeric expression or string expression.
Expressionlist-n If a case appears, it is the necessary parameter. A list of one or more constituent boundaries in the form of expre
The variables and operators in the three major elements of the code are described earlier, and the judgment statement in the statement is now in the following ways:
1, If condition Then [Statements][else elsestatements].
Description of each part:
Partial description
Condition necessary parameters. One or more expressions with the following two types:
A numeric expression or string expression that evalu
VBA (Visual Basic for Application ):
O 'Reilly VB VBA concise tutorial
OfficeVBAProgrammingCollection of manuals (CHM)
Microsoft Office VBA Language Reference
Microsoft Office 2007 system VBA programming
Office VBA programming skills
Advanced Knowledge points1. SQL query Statements and ADO2. Regular expressions and net catch3. Forms and Controls4. API class module and so onSorosayLinks: https://www.zhihu.com/question/26078625/answer/132542043Source: KnowCopyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.1 hoursFamiliarity with data types, variables, constants, and operators1. Understand what data types
The code below can be used to delete the module which houses the Code. In other words, it deletes itself after running once.
You will have to goTools>Macro>Security-Trusted publishersAnd check trust accessVisual Basic EditorBefore running the code. Change"Module1"To suit.
Sub deletethismodule ()
Dim vbcom as object
Msgbox "hi, I will delete myself"
Set vbcom = application. VBE. activevbproject. vbcomponents
Vbcom. Remove vbcomponent: = _
Vbcom. Item ("module1 ")
. ReadLineLoop2) Classic Open statement Reference: http://blog.sina.com.cn/s/blog_715070f20100w914.htmlA few examples:Write method, which must be used in conjunction with the comma ","Open"F:\test.txt" forAppend as#1 'Open the output file. Write#1,"Huo", Tui,"Chang" Write#1,233234, Write#1,"Huo", ChangWrite#1,"Huo", Close #1End SubThe use of the Print method is similar to write, but does not mate with commasIn print, the comma outp
I> 1' condition is true
... The statement to be executed
Wend
Select "VBA project trust"
Application. sendkeys "% (tmstv) {enter}" 'operation in the Excel window
Application. sendkeys "% (qtmstv) {enter}" 'In The VBE window
Application. commandbars ("command button name"). Position = msobarfloating 'Causes [command button] to be suspended in the table
Application. commandbars ("command button name"). Posit
VBA: Introduction and examples of dictionaries, and examples of vba dictionariesBasic statement
Sub dictest () 'Other detailed explanations for reference: http://club.excelhome.net/thread-868892-1-1.html' dictionary introduction' dictionary object is equivalent to a Union array, which is composed of a unique Key) combined with its Items, '
Original source: http://www.cnblogs.com/Charltsing/p/EncryptVBACode.htmlVBA code encryption is a commonplace issue, and since my VBA dumper was released, any encryption at the office level has lost its meaning. So, many people began to move to the VB package or upgrade to Vsto,delphi and other languages. However, for the vast majority of Vbaer, the problem of re-learning a language is far more than the benefits of developing
IamlaosongWhen the Excel file is processed with VBA, the column number of the keyword segment is often not known when programming. Need to know by the number of parameters, so. When we program, we cannot use this statement to take a valid number of rows:Lineno = [B65536]. End (Xlup). Row ' find valid rows from bottom to topThe column name "B" in the above statement
IamlaosongWhen using VBA to process Excel files, the key fields of the column number programming is often not known, need to pass parameter settings to know, therefore, when we program, we can not use such a statement to take the number of valid rows:Lineno = [B65536]. End (Xlup). RowThe column name "B" in the above statement, if it is a variable, can be implemen
Iamlasong
VBA programming achieves random output without repeating. The random function in VBA is RND, and the random function in worksheet is Rand. The difference between the word and can be remembered. The RND value range is [0, 1). It indicates a random number between 0 and 1, which contains 0, but does not contain 1.
1. Usage
Syntax: RND [(number)]If the value of number is generated by randomizeIf the v
Original source: http://www.cnblogs.com/Charltsing/p/unviewable.htmlqq:564955427Email: [Email protected]I was asked to unviewable+ VBA to protect the VBA code can be cracked, so I went to the author's website to see a bit (URL).This tool protects the VBA code fairly well, but there are still fatal problems that can be easily exported.Part of the code in the expor
call 283.2.7 variable 293.2.8 Program Process 333.2.9 Condition Statement 333.2.10 loop statement 373.2.11 array 413.2.12 utility and other 423.3 apply VBA to excel453.3.1 Excel Object Model 453.3.2 common objects in Excel Object Model 463.4 application instance 483.4.1 use VBA to merge columns 483.4.2 automatically h
Technorati labels: VBA, loop, for, while, do
From: julitta korol, "access.2003.programming. By. example. With. VBA. xml. And. asp", by wordware Publishing, Inc. 2005, p91-p101
(1) using the do... While Loop
Do While Condition
Statement1
Statement2
Statementn
Loop
(2) continuously display an input box until the user enters the correct password
Do While pword
Pword = inputbox ("what is the report p
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.