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
-
2
votes1
answer1590
viewsOpen another instance of Excel while VBA runs
I created an Excel application that extracts information from the internet, directly to it through the Selenium IDE Webdriver. However, while this application runs, I cannot open a new spreadsheet,…
-
2
votes1
answer82
viewsVBA Doubt - Forms
How to format the CPF field in the figure below? Grateful…
-
2
votes0
answers156
viewsHow to inherit a VBA form?
I need to inherit a form in a VBA to use it as a basis for other forms. For example, a form called "Table" contains a list of two columns and buttons for 'Edit', 'Include' and 'Rule out' the items;…
-
2
votes1
answer955
viewsName a cell
Goodnight, I am making a rule in vba that will run for all worksheet lines. So I created a variable, Cells(l,3) = "ID", but when I call this variable in the formulas is returning the word ID instead…
vbaasked 7 years, 11 months ago Mariana Pinto 21 -
2
votes1
answer1024
viewsExcel VBA check the contents of two cells
Good morning. I’m trying to create some modules in excel to help me work and one of the modules I created swaps all the accented letters and special characters of a "Cell" for letters without accent…
vbaasked 7 years, 10 months ago Otorrinolaringologista -man 133 -
2
votes2
answers1097
viewsExcel vba - Httprequest GET
I am trying to do a GET in VBA in Excel, and found several examples, below is what I am using: Sub http() Dim MyRequest As Object Set MyRequest = CreateObject("WinHttp.WinHttpRequest.5.1")…
-
2
votes1
answer256
viewsHow to remove a Label that was created dynamically in VBA?
The code below, sent by Luiz Vieira, creates Labels dynamically and a click treatment function for each Label. I would like to know how to use the Click event to remove the dynamically created…
-
2
votes1
answer739
viewsHighlight Textbox if the loaded value is equal in the worksheet
In a Registration Form when clicking search the textbox are completed. And if any of these Textbox has a value that is on plan1 from the "AS" column then this Textbox has the highlighted text (e.g.…
-
2
votes1
answer2823
views"Build Error" message (Loop without Do)
I don’t understand why I ever put Do Until! Private Sub cmdPequisar_Click() 'Verificar se foi digitado um nome na primeira caixa de texto If txtCPF.Text = "" Then MsgBox "Digite o CPF de um cliente"…
-
2
votes1
answer418
viewsCapture dynamic click checkbox event
I created a checkbox list as each category is entered into the database. However, I am unable to capture the click event of these dynamically created Checkboxes. Does anyone know where the error is?…
vbaasked 8 years, 7 months ago Kelly Soares 1,181 -
2
votes2
answers2141
viewsUSERFORM: What is the difference between Initialize and Activate routines?
What’s the difference in using Initialize and Activate as a Userform boot routine? Private Sub UserForm_Initialize() Private Sub UserForm_Activate()…
-
2
votes2
answers640
viewsAre there security problems by Auto Macro Run when calling Excel?
The link below deals with auto macro execution when starting the Excel I had the purpose of controlling the use of a VBA.…
-
2
votes1
answer1139
viewsVBA. I try to convert a txt to excel
Hello guys I have this macro to convert several txt for excel, but when it converts it does not separate the file by column ";" Sub Convert_Csv() Dim File_Names As Variant Dim File_count As Integer…
-
2
votes1
answer1441
viewsVBA doubt - Runtime error '91'
'Procedimento para o Comando Entrar Sub Entrar() 'converte texto usuario para minusculo - formando um padrao frmLogin.txtUsuario = LCase(frmLogin.txtUsuario) ' Primeira parte - Verifica os campos…
vbaasked 8 years, 6 months ago Ricardo Auzier 21 -
2
votes1
answer114
viewsConsolidate macros
I need to create a macro that allows me to choose all . xml files and import them into excel. At the moment the process is as follows: - I open the first one manually and then call the macro that…
-
2
votes2
answers421
viewsHow to expand range of numbers with data?
As I would in excel to expand a huge list with data to instead of grouping value data, it shows the content in total. Example: I’d like to transform that: Therein: Remembering that it will be a huge…
-
2
votes1
answer3446
viewsHow to import data from internet to excel vba
I’m trying to download a table from the site: "http://www.scoutscartola.com/mercado", and I already "got". But there is a problem in my code. I want the user to define the team. This is done by…
-
2
votes1
answer614
viewsVBA events in Powerpoint
Hello, Is there any event in Powerpoint that allows the execution of a subroutine when selecting a slide. For example, the presentation is running... When you get to slide 120 it has to run a…
-
2
votes3
answers1724
viewshow to close Word opened by VBA
For each Execution of the Deletesel function, a "WINWORD" is open in memory, even with the Close and/or Quit command it does not close. Sub DeleteSel(msg As Outlook.MailItem) Dim objDoc As Object…
-
2
votes1
answer6622
viewsMacro VBA for inserting images automatically based on a column of codes
Good afternoon, I have a spreadsheet, in which there is a column with the code of the photos and in the other column beside with spaces to insert the images. I wonder if there is any way to…
-
2
votes2
answers2802
viewsExcel/VBA file more than duplicates in size for no apparent reason while being saved
I’m working with the Excel and using some programming resources of the VBA via modules (without using forms), and there has been a problem, the file currently has 8MB and I saved continuously with…
-
2
votes2
answers1102
viewsEnter a password in the VBA Project via module or Sendkeys
Hello, I have a spreadsheet matrix that will enter in other thousands of smaller spreadsheets, will save in another extension, will put a code inside this and wanted it to block the vba project of…
-
2
votes1
answer5260
viewsVBA code to delete line
Guys, I have a code that checks the line if there’s a word or phrase and deletes the line: If Mid(Cells(i, 10), 1, 50) <> "Defeito" Then Rows(i).Delete Shift:=xlUp However I in the spreadsheet…
-
2
votes3
answers962
viewsHow to make the automatic recalculation of Excel trigger a routine in VBA?
I have a graphic scheme on Excel which is done by way of conditional formatting (see figure below), ie in the colored cells there is no content, only the background colors are changed based on…
-
2
votes1
answer139
viewsCell selection
I need to select the line with the value of combobox 1 and with the date of combobox 3 to select the desired line to delete. This is the problem I have to solve. Someone can help me? This is the…
-
2
votes1
answer8769
viewsCalling a macro in different modules
Guys good morning, I created several macros, but I want to unify everything, the same are in different modules. how do I put them together and run everything at once? follows the Cod I found but did…
vbaasked 6 years, 8 months ago John Hebert 151 -
2
votes0
answers46
viewsJoin Separate Fields in a Cell
Guys, I’m doing this code, but I wanted the P.O field to divide into the P.O values, but it only pulls one field, so it does that in the division .... Sub CalcularNotas() ' pl_Respostas.Unprotect…
-
2
votes1
answer482
viewsHow to delete or hide the password entry to access the data of a server with SQL Server from the VBA or Excel macro?
I’m running a database migration service from a server with SQL Server in a company, but requested that I broker the migration in Excel, because they want so in this first phase to advance some…
-
2
votes1
answer340
viewsCombobox does not update and accepts wrong values
Good, I have this code for a combobox, and I have two problems. First: I can’t get the combobox to accept only the list values Second: the listing has only one value Private Sub TempCombo_Change()…
-
2
votes1
answer578
viewsUnregistered class - Imagelist
When customizing my imagelist and listview appears the following error: Unregistered Class. Searching Object with CLSID:{7EBDAAE0-8120-11CF-899F-00AA00688B10} I believe it is because my Office is…
-
2
votes1
answer84
viewsHow do I make a customer list appear in a search from the name in Excel?
I have a client list; I want to do a search where you type in part of the customer’s name and then appear all the customers who have that name. Example: Social Status of Clients: João da Silva ME;…
-
2
votes1
answer1214
viewsIs VBA object oriented?
VBA can be considered an object-oriented language? Despite having getters and setters (or Letters… rsrsrs), implementation of classes, methods and attributes, lacks the concepts of encapsulation,…
-
2
votes1
answer74
viewsCreate image in another form
I have the following project: When I click the button works perfectly, no problem, but I wanted q the QR Code was generated in Spreadsheet 2 for example. Below the macro code Sub GenQRCode(ByVal…
-
2
votes2
answers910
viewsHow to call a variable from others?
My intention is that the code goes through 9 Textbox checking if they are filled with names or empty. For each Textbox filled would be added 1 in a counting variable and would be allocated the text…
-
2
votes2
answers2756
viewsChecking and Filling Excel Cells
I have the following spreadsheet as image below, I would like to create a VBA to check if the content inserted in the range of cells of this spreadsheet exists in the list of the second image below,…
-
2
votes2
answers790
viewsCheck with REGEX VBA if phone is fixed or mobile (checking 3rd number in regex)
I have to do a REGEX VBA that check the phone number in this pattern, I thought I would try to identify the 3rd number and check if it is different from 9 or 8, getting like this: Cellular…
-
2
votes1
answer2766
viewsHow to make a Dowload in IE via VBA?
Hello I am using the following code to start a dowload in Intenet Explorer. Public Sub Dashboard() Dim Navegador As InternetExplorer Dim objShellWindows As New SHDocVw.ShellWindows Dim currentWindow…
-
2
votes3
answers4302
viewsPicking tabs name in a closed spreadsheet
Hello, I have a master list of documents that update itself, it does not open any file, only uses the reference to find the data, but it turns out that some of the employees are changing the name of…
-
2
votes0
answers447
viewsAccess query via VBA
I have an Access base and I have problems with the QUERY result. When I run this same QUERY no access, it runs normally, but when I play in VBA it does not give error, but does not return any record…
-
2
votes0
answers72
viewsInteract with Silverlight
Good to all, I am developing a VBA system that searches documents (.pdf) on a certain site. However I came across a problem that I had never seen before, the site opens an IE tab with a Microsoft…
-
2
votes1
answer2559
viewsLimit characters and character type
I need some help. I have a spreadsheet this way: And I want to limit the amount of characters and the type In the segment column I want to limit it to 6 characters if it is less than 6 or more than…
-
2
votes0
answers99
viewsHow to use the same supplement . xla on two machines on the same spreadsheet?
I created a file with functions in VBA . xla that can be configured as excel add-on, but after using the functions in a spreadsheet any on my machine and sending the spreadsheet to someone else she…
-
2
votes1
answer48
viewsVBA Before Close
So what I want to do is have a message box that pops up when this Powerpoint file tries to close, saying "Did you send the data?" " Yes or no". If you click "Yes", Excel closes, if you click "No",…
-
2
votes1
answer136
viewsGet last Access column value
I’m developing a small application that inserts data into an access database. I am able to enter the data however I wanted to get the last ID value entered (automatic number) for a msgbox. provider…
-
2
votes1
answer50
viewsDoubt in VBA Excel 2013
I have this bit of code: Range("F8").Select For Each m In Range(Range("C8"), Range("C" & rows.Count).End(xlUp)) If ActiveCell.Offset(0, 0) <> " " Then ActiveCell.Offset(0, 7) =…
-
2
votes1
answer1371
viewsExtract Data between Lines from txt to VBA spreadsheet
I am creating a code that will automate reports at work from a button. The measuring equipment gives me a file in . mmf or . txt, and there’s an important part that I’m cracking my head to solve and…
-
2
votes1
answer2678
viewsOPERATION OF THE EXPLORER VIA VBA
Good morning, I’m starting to work with VBA so my doubt may be very basic, but my problem is the following: When I run the code (below) it looks like an error alert on the 'For each' line' "Runtime…
-
2
votes1
answer4893
viewsHandling of internet explorer using VBA
At the bottom of this site "http://sdro.ons.org.br/SDRO/DIARIO/index.htm" has an icon that downloads a file .xls. I needed to click on it and save the file, but I don’t know how to do it. It follows…
-
2
votes1
answer974
viewsVBA code to insert images in excel cannot recognize images that have letters and special characters in the image name
I use the following VBA code to take images from a folder and insert them into a spreadsheet, but the VBA code cannot recognize images that have letters and special characters in the image name,…
-
2
votes1
answer1044
viewsVBA - Select a file to attach in the email
Good morning Ladies and gentlemen, this is my first question. I never did, because I always find the answer in some forum, but this time, I lost! So let’s have my doubt. I used a mix of codes on the…