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
-
0
votes1
answer871
viewsCopy data from one column (B), to another sheet, if column condition (F) is met. excel
I tried and I keep trying several codes to automate the data copy (column B, spreadsheet proposals) to another spreadsheet (Projects), also in column B, if the F column of the worksheet "proposals"…
-
0
votes1
answer40
viewsSearch for items that are in within a given month of the year
I need to mount a macro for a spreadsheet that I am working on. I have a table with several columns in the tab ordem (in the date column has several dates with month and year type "22/02/2018), and…
vbaasked 6 years, 6 months ago Lindomar Marques 11 -
0
votes2
answers936
viewsQuery Data With VBA Filter
You guys, good night I have a problem in VBA, can help me please. Follow: I have an excel with Sheet1 and Sheet2. At Sheet2 I have a list of clients where I have the following data: Name, City and…
-
0
votes2
answers48
viewsHow to add spaces before a number?
I’m trying to add spaces before numbers. The first code worked, but I wanted to do it in the form of loop. Sub numeros() numero = Range("A2").Value n = 3 If Len(Range("A" & n).Value) = 3 Then…
-
0
votes1
answer927
viewsIdentify the ID/Number of each Text Box Shape
I started using VBA for Powerpoint and needed to start referencing in my code each Shape within the presentation. But I don’t know which is the name of each Shape to reference. How do I know that a…
-
0
votes1
answer203
viewsProblem Set Invokepattern = Button.Getcurrentpattern(Uia_invokepatternid) - vba
Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Declare PtrSafe Function SetWindowText Lib "user32" Alias…
vbaasked 6 years, 5 months ago Lucas Daros 19 -
0
votes0
answers238
viewsExcel VBA with slow array s to taratar data
I am developing a code to be applied in excel that summarizes the number of defects in a summary table. The data is imported from an xml file, which is opened by excel and created "layout" by excel.…
-
0
votes2
answers1823
viewsVBA - How to search words from one list in another and point "Found"
Good morning. Got stuck, in that. In the plan1 column A I have a list with 20 different words. In the plan2 Column C I have complex texts in each cell. I need to walk the plan2 Column C searching…
-
0
votes1
answer3006
viewsVBA x IE - collect data from a table
I am programming in VBA a collection of information on the website of the central bank. It turns out that the page does not fully load and when the macro ends only a few records were loaded into the…
-
0
votes1
answer134
viewsCalling Vba Project password
Hello, I need to run a macro which is the Private Sub Workbook_BeforeSavehowever the spreadsheet points out that the project is protected and therefore does not execute. I wanted to know how to call…
vbaasked 7 years, 5 months ago Leandro Felipe Moreira 423 -
0
votes0
answers47
viewsSearch image from a list
Hello, I have a list of about 1,000 products, the first column is the sku code and the second is the name. I need the image of this products that are easily found in Google by sku code. Is there any…
-
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
answer607
viewsHow to run macro with locked project?
Hello, I have a spreadsheet whose project has a password, however I want the macros to work and if the user tries to enter the macros he will have to put the password (I put in the project). I put a…
-
0
votes1
answer107
viewsVBA - Paste Reports into a Determined Sheet
I am mounting a macro that opens a specific report copy the data and paste into another spreadsheet in a given sheet. But I’m having a hard time at the part where I can stick it to the other…
-
0
votes0
answers112
viewsSelect in VBA Error 1004
good night My spreadsheet has a button where it will open a Form. This Form has a LIST VIEW where the data of a sheet of the spreadsheet is loaded. So far so good. Also in Form has a button to…
-
0
votes1
answer68
viewsModify Last Selected Button
I have a Userform containing multiple selection buttons 1-20. When I press the Tingirred or Tingirazul button the last selected button should be dyed red or blue. Could someone help me draw up this…
vbaasked 6 years, 3 months ago user123166 15 -
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
answer765
viewsHow to open a Userform with the same name as a button? VBA Language
My program consists of 20 buttons and 20 Userforms. I wanted to simplify the program and make a single Subroutine. Each time I press a button, the Checkbutton Checkbutton analyzes the name of the…
-
0
votes2
answers1643
viewsHow do I copy the default Userfom textbox value opened?
There’s an easier way than writing x = UserForm1.textbox2.value ? That instruction means: Copy the value of the Userform1 textbox. I wanted to replace the "Userform1" statement with something that…
-
0
votes2
answers131
viewsWhiten figure VBA Excel
Good afternoon. I need a macro to clear a figure, located in the spreadsheet, and reverse the coloring. Excel does not save the macro when I change the settings in the "Format" tab. I have already…
-
0
votes1
answer53
viewsHow to pick up the strings by picking up the line and changing the column
Set rgFound = Range("B1:B1000").Find(Sheets("FormAluguer").Range("E10")) If rgFound Is Nothing Then resposta = MsgBox("Não encontrado.", vbYesNo + vbExclamation, "stock incorrecto") Else Dim mrange…
-
0
votes1
answer41
viewsField of view of surveillance cameras in Excel
Good afternoon Commonwealth, I have a question about Excel, where I do not know if it is possible to make such a request. My goal is to take a plant and through a Solver, put surveillance cameras at…
-
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
answer136
viewsINSERT with Random SELECT
I have a table with several information and another empty. I need to do an INSERT in this empty table with only one information from the other table, but SELECT has to be random. I am using the…
-
0
votes1
answer3988
viewsRedeem the value of a variable in VBA and put in a cell in Excel
I have a variable (a name) declared in VBA how do I rescue this name to put in a cell of an Excel spreadsheet (if possible through a formula) Thank you
-
0
votes0
answers565
viewstake excel cell value below or next after checking the field name
good. I have an excel file that presents information below. i intend to extract some information and assemble a single table with the following columns: the original file, it breaks the information…
-
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
answer596
viewsSave IE file generated by Javascript using VBA
Dear friends, I am using the routine to access a page and download a file, which uses a javascript to be generated, but I need this file to be saved automatically, without user intervention. Sub…
-
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
votes1
answer90
viewsHow to "kill" a class in VBA - Excel
I have a code that calls a Private sub that in turn erases the data from a spreadsheet. If I do the same procedure without closing the form it gives error when deleting the data, but if I create a…
-
0
votes1
answer114
viewsScreenupdating x On Error Goto Errorhandler
With the code below: Application.ScreenUpdating = False Application.EnableCancelKey = xlDisabled On Error GoTo ErrorHandler 'Código Exit Sub ErrorHandler:Application.ScreenUpdating = True 'Código…
-
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
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
answer666
viewsVBA - How to identify last active line, when has formula
The code below identifies the last active line of the worksheet. When column A is filled in manually it works. But when I put a formula to fill that column according to another spreadsheet. The code…
-
0
votes1
answer55
viewsAlternate text of sharpes for saving config
hello would like to know if there is any problem/risk of using the Alternativetext property of sharpes objects to store working parameters has some risk of out of nowhere these data being…
-
0
votes1
answer74
viewsusing ROW() in VBA
Good afternoon, I want to multiply the value of the fourth cell on the left by the line number but there is an error when using Worksheetfunction.Row(RC[-4]) someone can help?? Range("H2").Select…
vbaasked 5 years, 9 months ago andhherson 7 -
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
votes2
answers335
viewsDisable Vba Excel View Mode
How to Disable Display Mode by Vba Excel. Wanted that when opening the spreadsheet the user already came with this enabled feature…
-
0
votes1
answer30
viewsReplace Database in Visual Basic 2010
Good morning, I am conducting a school project in Visual Basic 2010 with the link to an Access database. I happen to have to make some changes in the Database (Add Tables/Fields). I wonder if I can…
-
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
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
answer562
viewsCopy the contents of a spreadsheet and paste into a new one using VBA
Good afternoon! I need to create a code in VBA that copies the contents of several worksheets and paste into a specific worksheet. In case, it would have to have a repeat loop to open the sheets of…
-
0
votes0
answers39
viewsClick on the Autocad area outside the Form (VBA)
I need the graphic area of Autocad to be accessible when you have an active form. Which property should I activate, or what code I should create to make it possible.
vbaasked 5 years, 5 months ago Lino Cesar Cutini 1 -
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
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…