The following is an example of using Excel VBA to connect to Oracle and operate Oracle-related data.To connect to the database through VBA, Excel needs to install the corresponding Oracle client tool and reference the relevant components of ADO. to reference the components of ADO, follow these steps:1.
SQL query command stringAnl Open strcn ' Connect with database, if successful, return connection object cnRs. Open strSQL, CN ' executes SQL commands contained in strSQL and results are saved in RS Recordset objecti = 2 Set sht = Thisworkbook.worksheets ("test") ' Sht points to the Test sheet of the current workbookDo and not Rs. EOF ' When the data pointer is not moved to the end of the recordset, loop th
How to use VBA code to implement automatic daily backup of Excel documents
To achieve this "tall yet" features existing Excel features cannot be completed, but also the method of VBA programming. Of course, as you do not understand the VBA code, just follow the steps below
Once saw a "excel-home" produced "About Excel suicide function" video tutorial, after careful study, I wrote down their code, share in this.
Implementation ideas:Use VBA to create a hidden name, record the number of times the current workbook has been opened, and automatically delete the workbook if the number of times exceeds the specified value.
App
Here's an example of using VBA to connect Oracle and manipulate Oracle-related data through Excel
Excel connects to the database through VBA need to install the appropriate Oracle client tools and reference ADO related components, reference ADO related components can follow the following steps:
1.
There are many ways to delete empty rows and columns in exce, it is relatively simple to delete empty rows, just filter, filter out blank lines, Delete them, But it is difficult to delete empty Columns. Because you cannot filter by column to Delete. This feature is not in Excel. Of course you can use another method, that is, sort by column, sort the blank columns together, and then delete, but this method faces the problem that the order of the column
(range ("A1: A32 "))OrVaranswer = application. sum (range ("A1: A32 "))LcaseWhen determining the input characters, we cannot know whether the characters entered by the user are in upper or lower case. The lcase function can convert them to lower case:If lcase (selection. Value) = "Toto" then...OrSelect case lcase (selection. value)OrDo While lcase (selection. Value) Now ()Now () is both an Excel function and a VB
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
The following class excellibrary is a very common class that uses VBA to manipulate excel. It is my summary, arrangement, and reference in my work (I have used some examples from Microsoft) I have made many improvements and usage, and I will share them with you here.At first, the program had no comments. For ease of understanding, I just added some comments.
'Manipulate the
Excel VBA programming to draw a house on a form . This tutorial is to introduce you to use Excel VBA programming on the form to draw a house method, the tutorial comparison basis, produced the effect is very good, recommend to see.
Steps
Open the
use Excel VBA programming to draw a hexagon on a form. This tutorial is to share with friends the use of Excel VBA programming on the form to draw a hexagonal method, the tutorial is very good, suitable for beginners to learn, recommend you to see it.
Step 1
Open the
Write the Excel VBA tool to connect and manipulate the MySQL database.System environment:Os:win7 64-bit English versionOffice 2010 32-bit English version1, VBA before the preparation of the connection to MySQLTools--->references. ----> ReferencesTick Microsoft ActiveX Data Objects 2.8 Librarys and Microsoft ActiveX Data Objects Recordset 2.8 Librarys2. Install My
Although it is a very old technology, but when it comes to it, let's talk about it .....
Office EXCEL uses VBA to call WebService in two ways:
1. N years ago, Microsoft provided the mssoap30 component and compiled it for VC ++.. Net calls WebService in a similar way. They all add references, but the fatal defect is that 64-bit office is not supported.Program(Supports 32-bit office running on 64-bit mach
While it is known that Microsoft Office Excel can support the writing of complex programming and custom functions in the VB language, there has been no such requirement.The problem is to calculate a value based on a list of arrays, but the computational process is more complex, it takes a few steps, if you do not program, you have to go through some intermediate cells to complete the calculation, but this will make the whole table is very bloated, and
Workbooks. opentext (filename, origin, startrow, ype, textqualifier, delimiter, tab, semicolon, comma, space, other, otherchar, fieldinfo, textvisuallayout, delimiter, thousandsseparator, delimiter, local)
For more information about the meanings of the preceding parameters, see the help of VBA. In actual programming, it is generally not necessary to process these complex parameters. You can use a recording macro to obtain the
In work, Excel + VBA is often used for some data operations. When reading thousands of rows of data, a progress display is required. Although VBA has a progress bar with an active control, it cannot be used properly.
So I made a self-made one and displayed it in the status bar.
Code:
'Custom progress bar. Function getprogress (curvalue, maxvalue) dim I as si
1, VBA traversal to add a reference, runtime2. You cannot open a separate application because the newly opened application is not available when you get to the Picture property of shape. Prompts for automation errors.3. Positioning shape, the width and height of shape is required because it is based on the location of the center point. CellsSRC (visSectionObject, Visrowxformout, Visxformpinx). FormulaUSet t
Tags: select Name records width INF from HTTP POST VATThe first step is to download the Postres driver on the Internet, after installation,: https://www.devart.com/odbc/postgresql/download.htmlSecond step to create an ODBC data sourceClick "Start-" control Panel-"Management tools-" data source (ODBC)-"User dsn-" Add "Write VBA code after the installation is configured.private Sub CommandButton1_Click () Dim CNN as New ADODB. Connection Dim rs as New A
) ElseIf Mid(C, I,1) ="." Then 'consider decimalsTemp = temp Mid(C, I,1) ElseIf Mid(C, I,1) ="-" Then 'consider negative numbersTemp ="-" End If NextI tonumber=TempEnd FunctionDescription: -----1. In fact, this function can calculate the difference between any two numbers of strings with numbers;2. Can handle the decimal, with 1 minus the two special stations, but can not accurately identify the station with 2 minus sign. Of course, the 2 minus sign of the station is ve
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.