Most voted "excel-vba" questions
VBA (Visual Basic for Applications) is the programming language of Excel and other Office programs. Use the Excel-Vba Tag when you have scripts problems of a Vbaproject in direct relation to the interface of Excel spreadsheets.
Learn more…335 questions
Sort by count of
-
0
votes2
answers1621
viewsPass values from one form to another
Expensive I have two A and B forms. A = Has listview and displays base information B = Need to receive form A information and display. (Information that is not displayed in form A) I need to make it…
-
0
votes1
answer236
viewsUpload image in Excel from a directory
Good afternoon! I am using the code below to load images in excel of certain directory plus my formula is showing error. Follows the code: Public Function getImage(ByVal sCode As String) As String…
excel-vbaasked 7 years, 4 months ago Alessandra 1 -
0
votes0
answers1999
viewshow to click the "ok" button on an Internet Explorer alert using VBA?
Hello, I have a VBA code that accesses a web page and deletes the entries. The moment I click the button "delete item" opens an alert on the screen with two buttons ("okay" and "Cancel") and…
-
0
votes1
answer1019
viewsRename PDF File
Boa Tarde Comunidade, I am trying to create a macro that renames 125 PDF files that are in a specific folder C:... I want it to replace the name that is in my column B... Like to get the PDF in the…
-
0
votes1
answer110
views -
0
votes1
answer1649
viewsHow to count different names in a vba column?
Good people, I have a question in a work in vba in which, in a column, has four brands of cars: And you’re supposed to put on cell C15 the brand you want to look for and on cell D15 you have to show…
-
0
votes1
answer863
viewsVBA Print by Pdfcreator
I am trying to print an IE file by Pdfcreator, in my searches I could not locate a VBA form to perform this process, I even found an algorithm that says to do this, but I could not solve a problem…
-
0
votes0
answers468
viewsVBA - generate csv from cells
I am wanting to generate a CSV file from the data of 3 columns, but they presents me an error, could help me? Follows code below: Sub GravaTXT() Dim wbkExport As Workbook Dim shtToExport As…
-
0
votes1
answer1278
viewsMacro VBA for Exel - copy data from one sheet to another with one condition
Hurray for you guys, I’m completely new to VBA and a major programmer. I need help to build a macro for Excel. Context: In the Excel book that is found in the following link, I intend to develop a…
-
0
votes1
answer483
viewsDoes not locate element with findElementById
Expensive, I am trying to fill two text fields (login and password) of a given page. Using the following code. (Both by byID, bySelector, neither works) driver.findElementByName("usuario").SendKeys…
-
0
votes3
answers1426
viewsFind element without tag ID and Name
Expensive, I need to locate the element that does not contain id and name in HTML. Below is the HTML example <button type="button" class="btn btn-primary ng-scope" data-ng-if="novo2()"…
-
0
votes1
answer233
viewsSelect
Expensive, I am trying to select an option in a select with the following code and am unable to find a solution. I can locate the element, but not tell it to select X option. I’m tracing with the…
-
0
votes1
answer815
viewsAutofilter Excel VBA
I have a problem, when trying to make an autofilter in vba it is trying to filter the values I chose but ends up not filtering value, I searched a lot and found no explanation. The code is as…
-
0
votes1
answer5283
viewsVBA - Application definition or object definition error
I am trying to recover the amount of rows from an excel spreadsheet to format it, but am coming across application definition or object definition error. Below is the code snippet. Private Function…
-
0
votes0
answers205
viewsCopy multiple sheets into a single file
Good afternoon, I made a code to capture a Sheets of a given spreadsheet, however now I want to take more than one and save all in a single file, but I’m not getting anyone could help me? Private…
-
0
votes1
answer725
viewsRunning time error '91' The object variable or the block variable with has not been defined
I do not know how to play very well with excel, I have to make a graph using buttons and gave this error Sub logs_acumulador() ' ' logs_acumulador Macro ' ' ActiveChart.SetSourceData Source:=Range(…
-
0
votes2
answers600
viewsFor nested parallel VBA Excel
I’m performing a For inside another For, where you run by column, find the cell and copy in the other For run column as well and paste into a range. However, the code is performing an entire For…
excel-vbaasked 7 years, 1 month ago Edilaine Martins 11 -
0
votes1
answer143
viewsIs there something wrong with that code?
Function Check() Dim valorA, valorB, valorG, valor2 As String Dim rng As Range valorG = Cells(ActiveCell.Row, "G").Value valor2 = Cells("2", ActiveCell.Column).Value For Each rng In Range("A3:A321")…
-
0
votes1
answer65
viewsHow to hide a table in excel without resizing the chart
I would like to hide a table but it feeds a graph, I would like to do this without resizing the graph. This chart uses selection buttons that have been formatted with macros.
-
0
votes1
answer45
viewsFormatting graphs in Excel
How to make so that when I take the information from a server using mysql, this information appears in the chart sheet already formatted in excel?
-
0
votes0
answers174
viewsEXCEL: Form filled in specific places
In this image I have 7 "blocks" to be filled via form, they are side by side. As I do in vba a function that fills these blank fields of TM1 and TM2 automatically, I want to include this function in…
-
0
votes1
answer262
viewsFilter VBA function
I am using the code below to check if an element is in a matrix related to a Range. It happens that in some cases the result is = 0 demonstrating that it exists, but does not exist. What’s wrong?…
excel-vbaasked 6 years, 7 months ago Adilson Weber 1 -
0
votes0
answers60
viewsPhoto of a database
I have a spreadsheet that I need to place photos pulling from a database. The trigger would be the product code. When entering the product code, the photo of the product would go up to the…
-
0
votes1
answer73
viewsVBA / Macro - Cleaning Data
Hello, I’m here cracking my head on how to modify a spreadsheet through a macro. Can anyone please help me? I have a spreadsheet (Plan1) that has A1:AF720 formatting. I need to create a macro so…
-
0
votes1
answer60
viewsHow to replicate a value depending on what is inside the cell?
I have a code that always puts 264 empty characters after the last word typed inside the cell; then puts more "00000000000000" after 264 empty characters and export to txt, as shown below: My…
-
0
votes3
answers2568
viewsGoto Error Handling Does Not Work in Loop
I have an application running in VBA, in it I have an error treatment that works perfectly the first time the action goes through it, but it is inside a For Each loop and the second time it simply…
-
0
votes1
answer685
viewsBlock printing via "Print" macro menu
I wonder if there is any way to block the printing of a sheet by the File-Print menu (Ctrl+P) or by the printer icon, through a macro. Yes, I made a macro that when pressing a button it will make a…
-
0
votes1
answer157
viewsMessagebox in VBA in Excel
Dear friends, good afternoon I am working on a dynamic table in excel and I would like when the store text 10 was typed, it displayed a warning that this store is unavailable, I know I need to call…
-
0
votes1
answer414
viewsIncrement in String in VBA excel
A Strign in VBA excel has the following value: "T110A17014". I need to increment this string every time. To increase only the last position the code below works! Now if we have this value:…
-
0
votes1
answer175
viewsActivate found cell
I’m having trouble activating the cell that was found. The code is as follows:: Private Sub cmdPesquisar_Click() 'Verificar se foi digitado um nome na primeira caixa de texto If Txtnif.Text = ""…
-
0
votes1
answer66
viewsHow to fetch excel sheet info to drop down in Visual Basic
I have to dropdown with information that I already have in an excel sheet in Visual Basic, how do I get that same information? And make sure there’s no repeat information? Example: colunaA a a a b b…
-
0
votes1
answer961
viewsExcel VBA changes the date format to mm/dd/yyyy
I’m developing a spreadsheet on Excel using the VBA, which will function as a "micro-system" of registration. I have the following problem: every time I type the date into the cell Cad_0, for…
-
0
votes1
answer61
viewsClose Excel after running Macro vba on Qlikview
Macro set obj = ActiveDocument.GetSheetObject("CH1") obj.Export "caminho_para_salvar_arquivo" And now I need to close Excel, I used the following command. obj.Close caminho_para_salvar_arquivo' And…
-
0
votes1
answer42
viewsSave php parameter in vba variable
I have a form I step a parameter and at the same time open an Excel spreadsheet. Following example: <?php if (isset($_GET["param"]) && !empty($_GET["param"])) { $param = $_GET["param"];…
-
0
votes2
answers107
viewsI have a password in excel and want to change it in vba
If Me.boxPassword.Value = "12345" Then Unload Me Sheets("Configuração").Visible = True Sheets("Configuração").Select Else Me.Hide Retry = MsgBox("Passe incorreta, Tentar outra vez?", vbYesNo,…
-
0
votes1
answer89
viewsHow to delete straight parentheses from some subfolders I have using an excel macro?
I have a folder called "Franchisees" where there are several subfolders with the names of franchisees. Inside each franchisee’s folder there are some subfolders whose names contain straight…
-
0
votes1
answer405
viewsGet User name from an Excel login
Good afternoon. I have a login in excel that generates a log of Users. I can put in a worksheet cell the name of who logged in, but when another user logs in, the name of the previous user also…
excel-vbaasked 6 years ago Dario Jose Volpi 1 -
0
votes1
answer2198
viewsVBA Code: Block specified cells without protecting the entire spreadsheet
Good afternoon You can help me with the formula below? I need to include more columns and other specific cells.. but I don’t want to block everything. Private Sub Worksheet_SelectionChange(ByVal…
excel-vbaasked 5 years, 11 months ago Carlos PvP 3 -
0
votes1
answer2266
viewsRuntime error 1004 in VBA
Good morning, I made the following code, it runs the code but always appears 400 error message or 1004 runtime error, someone could help me? Sub atualizarprecos() j = 2 For m = 1 To 1000 For i = 4…
-
0
votes2
answers2677
viewsCopy data from one spreadsheet to another
I have a problem in one macro, I am trying to copy data from one spreadsheet and paste into another, but this giving an error when doing the insertion of a new line (in yellow). Spreadsheets: Code:…
-
0
votes2
answers735
viewsVBA Merged Cell
Good afternoon, Does anyone have any idea how to return the value of a merged cell in VBA programming ? For example: I would like range N6 to return MAI/19…
-
0
votes1
answer123
viewsBlockinput VBA/EXCEL
I need to lock the commands in my macro in Excel. I am using the following function: Public Declare Function BlockInput Lib "user32" (ByVal fblock As Long) As Long On the computer with 64 bit win…
-
0
votes1
answer32
viewsDuplicate spreadsheet
Hello, I have a spreadsheet that contains some important data, I wonder if there is any to duplicate this spreadsheet automatically, so that I manipulate the data in a spreadsheet and when click to…
-
0
votes1
answer357
viewsMacro to join two Excel columns
Hello! I have a question about Excel. I have two columns, I would like a macro that when used, transforms all the rows of these two columns into rows of only one column. I know I can use the…
-
0
votes0
answers53
viewsData Input - Listview
Good morning guys! Well, I created a data update form with a listview view! I put the value in the textbox, click on the desired line and click on change and the value on listview is changed but in…
-
0
votes0
answers31
viewsEdit cell value in wrong tab
Guys first good day! I have a problem because I made a button to edit the value of a certain cell, however my file has 10 different tabs, and it is registering in the wrong tab, as I can do to…
-
0
votes1
answer443
viewsDelete whitespace from Activex Excel combo box
I have a default list with values and another list of "Organization" when I delete values from the default list to another organization list, organize values. The problem is that I added a combo box…
-
0
votes1
answer137
viewsCapture an excel autofilter criterion based on cell color
How to capture an Excel autofilter criterion that is based on cell color? Code: Sub GetCellColorCriteria() With ActiveSheet If .AutoFilterMode Then With .AutoFilter.Filters(1) If .On Then If…
excel-vbaasked 5 years ago user169315 11 -
0
votes1
answer114
viewsHow do you translate this English excel formula into Portuguese?
The formula is this: = IF (E2 = 1, SLOPE (OFFSET (E2,0, -1, ninbox, 1), OFFSET (E2,0, -4, ninbox, 1)), ””) I’m using the following, which is not working: = SE(E2 = 1; INCLINAÇÃO (DESLOC(E2;0;-1;…
-
0
votes1
answer619
viewsUpdate dynamic table with connection to a Stored Procedure using Macro VBA
I aim to bring the data from a Stored Procedure to a spreadsheet in Excel. This Stored Procedure is using two parameters for the query. Excel 2013 SQL Server What do I have I set up a macro that…