Most voted "vba" questions
Visual Basic for Applications (VBA) is an event-oriented programming language with limited object support, used to write macros, available for the entire Office suite.
Learn more…792 questions
Sort by count of
-
29
votes1
answer22467
viewsMacro to access site with login
I run a daily routine of accessing the Serasa site and make the CNPJ query. I need to develop a macro to access this Serasa site, log in and then query, and then play the information in Excel.…
-
12
votes2
answers1686
viewsVBA/Excel Combobox : Disable Auto-Complete
I’m typing a text that’s in a Combobox of VBA/Excel, but the initial part of the text matches another already included in the list, besides completing it automatically (which I do not want), it…
-
12
votes1
answer12831
viewsWhat are the main differences between VB.NET, VB6 and VBA?
What are the main differences between VB.NET, VB6 and VBA?
-
10
votes1
answer15267
viewsHow to generate a full value in Portuguese in MS Office Excel?
In an Excel spreadsheet, having a cell with a numerical value, how to calculate its value in full? For example, in the cell A1 have the value R$ 587,32. I need a function that passes the cell as…
-
10
votes1
answer17922
viewsMacro VBA search information on site
I need to search information on a real estate site and bring them to excel. I did the macro below: Sub zap() Set ie = CreateObject("InternetExplorer.Application") With ie .Navigate…
-
9
votes3
answers4914
viewsRun VBA code from text file
I have a code in VBA that queries the database and saves it in a text file, but to run this script I have to open the Excel and perform the macro, this process has to be carried out from minute to…
vbaasked 10 years, 7 months ago Lucio Rubens 3,384 -
9
votes1
answer877
views -
8
votes2
answers2097
viewsMysql connection failed via VBA
I am trying to connect to a Mysql database via Excel VBA, but returns an error stating catastrophic failure. I made a test by putting the wrong password, or the name of the wrong database, and it…
-
8
votes1
answer7609
viewsHow to acquire information from the IEC (Investor’s Electronic Channel)?
Forgive my layperson, but there is an API that allows me to pull a user negotiations, knowing the login and password of the same ? Or would it be the case to make a Crawler ? I’ve seen several…
-
7
votes1
answer1225
viewsVBA - Backpack problem
In excel I have the following table | Produtos | Preço | | Produto A | 100 | | Produto B | 250 | | Produto C | 200 | | Produto D | 800 | | Produto E | 560 | | Produto F | 970 | ... And I would like…
-
7
votes3
answers6519
viewsHow to get a difference between two dates?
Let’s just say I have an initial date equal to 30/01/2014 10:00 and a final date equal to 02/02/2014 10:00. I would like to know if it is possible to obtain a grid containing these results: If…
-
7
votes1
answer2260
viewsHow to include visual progress information in a Powerpoint presentation via VBA
I have a Powerpoint presentation and would like to build a program in VBA to count the slides and include in each of them a kind of "progress bar", in order to indicate to the public the progress of…
-
7
votes3
answers438
viewsHow to make a standalone script using Global.asa
I’m looking to run a script that records information into the database every 24 hours. I’m not the server administrator, so I don’t have access to Scheduled Tasks, I read in some articles that I can…
-
7
votes1
answer2081
views -
6
votes2
answers606
viewsCompetitive when using time table
I am using a vba code that transfers some data to an auxiliary table, handles and back to the original table. How do I solve the competition problem? That is, I didn’t want two users to use at the…
-
6
votes2
answers1419
viewsAlternatives for VBA development in Office
At work I have a large code base written in VBA (approximately 13 active projects), both for Access or Excel applications. I’ve been trying to refactor some things, but several factors are making my…
-
6
votes1
answer7019
viewsReceive vector size
I would like to know how to have the size of my vector in VBA. I searched some things but could not locate anything. How can I recover this value?
vbaasked 9 years, 4 months ago Paulo Henrique Gallo 105 -
6
votes2
answers1475
viewsHow to access a value that was placed via Javascript from a site via VBA?
I’m trying to access the values that appear on the site: http://www2.bmf.com.br/pages/portal/bmfbovespa/boletim1/BoletimOnline1.asp?caminho=&pagetype=pop&Acao=BUSCA&cboMercadoria=DI1 I…
-
6
votes2
answers2501
viewsDelete a macro using another
How to program one macro to delete another? Would it be something like, when, I need to call? Ex.: Sub callmacro() Call macro1 End sub And better yet, if I want to program it to delete itself? Ex.:…
-
6
votes1
answer270
viewsVisual Basic Excel - Delete an array name
I’m here with some problems, I never touched Visual Basic and I was wondering if it would help me to make a list I have in Excel faster (Through Visual Basic Excel). It’s very simple, I just want to…
-
6
votes1
answer462
viewsVBA/Excel - Subroutines stop while typing
I am working on a spreadsheet where the user has to type a given text into a cell at a certain time. I want to put a countdown side, so he can check how much time is left. However, when I start…
-
6
votes1
answer901
viewsVBA Download pdf
I am developing a macro in excel that through a list of id and passwords in excel logs into a website and tries to download a pdf. I can log into the site and navigate to the button that generates…
-
6
votes1
answer22028
viewsAdd photo in excel spreadsheet from local folder
I have a spreadsheet in Excel with a list of people. For each person I have a code. In a local folder I have photos of these people and the file name of the photos is the code of the person. Do you…
-
6
votes1
answer1200
viewsFind column and position cursor in it
I have a spreadsheet that contains: COLUNA A1 CABECALHO (PRODUTOS) COLUNAS B1 A BK1 COM DATAS I will read a database ordered by product and date and have which automatically fill in the spreadsheet…
-
6
votes1
answer571
viewsVBA Regular Expressions - Extract substring
In the text below, I would like a regular Pattern Expression, compatible with VBA, to extract the text located between the equal sign "=" and the first line break (highlighted in bold): Client = CON…
-
6
votes1
answer3103
viewsExcel - VBA sum +1 to line
I have a question . I’ve been testing the macros to fill out a database but I’m having a problem. ID - Name ZZ1 - A ZZ2 - B How do I add this automatically? (now ZZ3) I have the following code that…
vbaasked 6 years, 11 months ago ChrisAdler 1 -
6
votes4
answers7295
viewsHow to generate a spreadsheet from another using VBA
I have the worksheet below with the following columns: I would like to generate a second spreadsheet based on the above information, following the following conditions: a) If categoria ==…
-
6
votes2
answers2083
viewsBlock cell filled with VBA
We are setting up a routine where when filling a cell (C1, for example), automatically is filled date (A1) and time (B1) in the spreadsheet. Only right after the auto-fill I need the 2 cells to be…
-
6
votes1
answer6469
viewsMacro email range + signature
Good morning. I need help in a macro for sending emails in Outlook 2007. I have a macro that selects a certain range of cells (all right and all down from a referenced cell) and pastes in an email,…
-
5
votes3
answers3831
viewsCheck if number is integer in Access
How to check if a number is integer in Access VBA? I tried to If Int(Me.Numero) Then Msgbox "É inteiro" End If But it didn’t work. I wanted if I typed 8.5 it returned "It’s not whole". The field is…
-
5
votes2
answers19521
viewsVBA - Counting the number of filled cells in the row
Hey there, guys. I’m trying to create a code responsible for reading the number of filled cells in the lines.. I tried this way but I was unsuccessful. For b = 1 To rMaior contador =…
-
5
votes1
answer4116
viewsuse excel spreadsheet to fill web form
I have a spreadsheet in Excel, it was generated from a form of a system and then some data were selected. After that I have to put this data in another web form, this form is in another system other…
-
5
votes1
answer1654
viewsmacro to copy and paste
I have data in column "M", which are entered automatically, on an average of 70 rows per month, only it has empty cell ranges (the 12 months of the year are in column "M"). So I wanted to copy this…
-
5
votes1
answer677
viewsHow to modify VBA function to write a number greater than 1 trillion in EXCEL cell?
In 2013 a user sent a question about how to write out a number stored in an EXCEL cell. One of the answers contained a VBA function that had already been published by UOL for some time. I consider…
-
5
votes1
answer3351
viewsMACRO in Excel - printing with sequential numbers
I have a macro from a few years ago that still works, when I click to print the production orders of my company, I put the start and end number, and the macro prints the Ops with the numbers in…
-
5
votes1
answer5547
viewsImporting data from a web page to Excel via VBA
Here’s the thing: I found the code on the Internet that works perfectly with what you’re indicating, but I need to adapt it to a project and I’m not getting it. In short, the macro accesses the page…
-
5
votes1
answer235
viewsBug in code, function repeats calling when opening excel file
Further to this question: /a/112899/13237 Code: Function PrinciQualidade14(LNumber As Integer) As String If LNumber < 15 And LNumber > 0 Then InsertPictureInRange LNumber,…
-
5
votes2
answers4543
viewsHandle spreadsheet with userform loaded (excel vba)?
When we’re with a userform loaded, it is possible alter/navigate in the spreadsheets of excel?
-
5
votes2
answers728
viewsFind equal ranges in a list
I am a beginner and I tried almost everything but I could not solve the issue and I wonder if someone could help me. In a column I have numeric values and I would like to compare the intervals of…
-
5
votes1
answer27154
viewsIs it possible to comment several lines at once in VBA?
There is the equivalent of /**/ of c# to comment on vba instead of using plicas on each line 'Function Prodcet30(a As Double, b As Double) As Double 'If a = 0 Then ' MsgBox ("Por favor introduza o…
vbaasked 7 years, 4 months ago Amadeu Antunes 3,331 -
4
votes1
answer1312
viewsDrop-down list with repeat criteria
I have a conference list, where in Plan1, column A', will be typed only the cods that are in Plan2, column A' more with a criterion can only repeat the total of times that is in plan2. To type in…
-
4
votes1
answer5086
viewsHow to "Copy and Paste" a VBA form?
I have a form ready that I want to take advantage of everything I did for him but in another form, it would be the case to do something similar to "Copy and Paste", has how to do?
-
4
votes1
answer451
viewsBlock fields in Subforms in MS Access
I have the following form with a Subform: And I need to enable Check in "Approve3" and lock the other fields, but I can only get "LOCK" all or none, how can I go around? Maybe by flying in? I…
-
4
votes1
answer177
viewsVBA for searching photos in a folder and concatenating filenames without duplicating
In February I asked for help in a code to group photo names I have in a folder (product photos) belonging to the same product, such as can be seen in this other question. My problem has been solved,…
-
4
votes1
answer233
viewsRange.Paste Runtime error when pasting web data
Hello. I am extracting some data from an html table of an ERP that due to limitations lead me to it. Anyway, the problem consists of, when copying the table and trying to glue it with range.Paste or…
-
4
votes1
answer214
viewsCreate add-in that associates number to an image
I need to create a supplement (add-in) that associates a number to an image. Example: =getImageQualidade(1) 'e nessa célula ficava a imagem. I already know how to create/implement a basic…
-
4
votes1
answer482
viewsHow to treat unusual closing of a Combobox list in VBA?
I am creating an important effect for the presentation of a Combobox in particular. This Combobox is originally produced centralized, and when opening your list I make the text left-aligned so that…
-
4
votes1
answer2153
viewsA Macro to run all Modules?
I have several modules and within these modules I have several subroutines with some functions on separate sheets. I intend to run macros separately! That is, start the next subroutine after…
-
4
votes1
answer3070
viewsVBA+Excel. Code error (incompatible Byref argument type) in Function
The following code: Sub segundograu() Dim a, b, c, delta, raiz1, raiz2 As Double a = Range("B3").Value b = Range("E3").Value c = Range("H3").Value delta = b ^ 2 - 4 * a * c Range("E5").Value = delta…
-
4
votes1
answer1532
viewsCopy and paste cell when changed
I’m starting to use VBA with the office package, as I still know little I’m having difficulties to get this functionality. I was trying to do something simple and I needed help to understand how it…