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
votes0
answers32
viewsMove images vb6, Msaccess.vba
I added an image and a Button to a form, created this code: Option Compare Database Private Sub Command0_Click() Do Until Me.Width < 4000 Let Image1.Left = Image1.Left - 5 DoEvents Loop End Sub…
-
0
votes1
answer438
viewsExcel button to choose
I want to know if it is possible with buttons or list or with some formula. For example I have a list with name of countries (Portugal, Spain, Brazil) and I want in the other list just show me the…
-
0
votes1
answer3120
viewsValidate field in VBA
In Mozambique there is a unique tax identification number (Nuit), and this number takes 9 digits. How an application would look to validate the Nuit meeting the following conditions? If there are…
-
0
votes1
answer2156
viewsIP control with Excel + VBA
I’m building some functions to analyze an IP table. I just used VBA for the first time in my life and in my research I found nothing that could help me. I need to create a function that looks for…
-
0
votes1
answer335
viewsIdentify path or letter of DVD drive in autorun
I am creating an application that must be run by DVD-R, and you also need to run background programs using the command process.start("D:\Local do arquivo"). But there is my doubt: if the client has…
-
0
votes1
answer2054
viewsFind directory using wildcards
How to locate a folder as a file? For example, the code to locate the file TESTE.TXT is: b = dir("c:\minhapasta\t*.*xt") msgbox b But for folders the asterisk does not work. Which alternative we…
-
0
votes1
answer3804
viewsHow to change a cell based on the value of another cell?
Problem: Import data does not come with zeroes on the left I imported data from a text file, but even configuring to import in TEXT format, the cells of a column that in the file was 08 are imported…
-
0
votes1
answer16582
viewsMerge duplicate names into one line
I have this spreadsheet: I have in the spreadsheet the client ELISMAR CARLOS RODRIGUES DA MATA, who made 3 purchases, two on the date 10/08/2014 and one on the date 20/08/2014. What I need is to…
-
0
votes1
answer805
viewsVBA does not recognize values
I am trying to get data type values from a certain excel cell, however, my macro does not recognize the values of the cell, even if it is filled (date). Remembering that there are three Heets. With…
-
0
votes2
answers555
viewsSecurity Message on Activex control
System: Windows 8 and Microsoft Office 2013 I am having problems with an alert screen on Activex control that has been bothering me for some time: Before opening the Form where the Windows Media…
-
0
votes0
answers85
viewsChanges made to a record are reflected in the other records (Access + VBA)
I created a Vehicle reservation form where I have a field where the user must enter the destination of the trip. The user may also need more than one destination, so I have created an…
-
0
votes0
answers288
viewsText Checkbox "Yes" and not "True"
Good afternoon, I am producing a form and I need to know how to do so when the Checkbox is selected it delivers the text "Yes" and not "True" (my excel is in English) . I believe that this is a…
-
0
votes1
answer1193
viewsProblems with Error '9': subscribed out of range
I’m creating a customer register, and every time I debug when it comes to: totaldelinhas = Worksheets("bancodedados").UsedRange.Rows.Count + 1 caixa_Localizar.RowSourceType = "bancodedados!a2:a90"…
-
0
votes1
answer583
viewsHow to drag some objects and forms in VBA/Excel and prevent the drag of others?
I’m having difficulties when trying to control "drag forms" and "drag objects" in VBA/Excel. For example: I have the main form that I don’t want to be moved, a second form is called from the main…
-
0
votes1
answer48
viewsFunction upload multi attchements
I’m trying to create a function to upload multiple files at the same time but even with one get an error. What I might be programming wrong? 'FILE DIALOG OPENS UPLOAD PANEL Private Sub…
-
0
votes0
answers178
viewsLoad multi-attachements in various attachments in form
I am trying to create a function to upload multiple files at the same time but I think because I am choosing the next function does not actually attach the file but creates a preview. In my optics I…
-
0
votes0
answers65
views -
0
votes2
answers651
viewsFill value in Internet page
So people want to put a value on a web page, but before that I log into it and I’m directed to another page, there I navigate to a different page, and I took a look at the page code and the place…
-
0
votes0
answers163
viewsOrganizing EXCEL data
My goal is to interpolate Cubic Spline. For this I am organizing my data as follows: I made a simple modification. I calculated the working days between the day in column B and the dates. For the…
-
0
votes2
answers4700
viewsHow to find out if a number is odd or even?
How to find odd and odd pairs from this list? Sub kati() For li = 1 To 10 For col = 1 To 10
-
0
votes1
answer546
viewsnumber even, odd, zero and more than 10 how to find?
For g = 1 To 10 For f = 1 To 10 Cells(f, g) = Int(100 * Rnd()) k = Cells(f, g) If Int(k / 2) - k / 2 = 0 Then pares = pares + 1 Else Impares = Impares + 1 End If If k = 0 Then Zeros = Zeros + 1 If k…
-
0
votes1
answer722
viewshow do I sum all the numbers in each row and column?
I am trying to sum up all the numbers of each row and column. I tried to do as below, but it is not working. ranger .ClearContents For n = 1 To 10 For Z = 1 To 10 Cells(Z, n) = Int(100 * Rnd()) k =…
-
0
votes1
answer845
viewsColor Palette (VBA/Excel), "right mouse" event for Frame objects
I found no reference to the event that is triggered by the right mouse button on a Frame object. With the event of the left mouse button select the desired color, this is working, however, with the…
-
0
votes1
answer443
viewsHow to make a public routine for all forms without being tied to a form?
I have several forms in my application, and I can start the call by some of them running partial for testing (not necessarily START from the main form). In addition to the public variables that are…
-
0
votes1
answer380
viewsHow to paste text in the same Excel column?
I copy data from a PDF and would like each row to be pasted all in the same column "A", because then I have a macro that does all the work of dividing into columns that works very well. On my…
-
0
votes1
answer181
viewsExcel - VBA: Need support to lynch the Max function
How can I reference a certain column sheet through the command below in VBA? Application.WorksheetFunction.Max
-
0
votes1
answer62
viewsVBA MS Access - Version application
Someone knows how to change the version of my access app. Like, in C# one I put the version number in the Assembly file, and then I can take that is put in a label for example. How I do this in VBA…
-
0
votes1
answer281
viewsAdd photo in excel from local folder
Hello, I followed every step here - Add photo in excel spreadsheet from local folder And it all worked out well. But I wanted to resize the images and align them to the center of the cell -…
-
0
votes0
answers25
viewsVB Module - How to direct to a website
Hello, So I tested several methods, but I got nothing with what I want and so I came here to ask for help. Here’s the thing, I need that when accessing by the example browser:…
-
0
votes3
answers11310
viewsExtract text with VBA
I need to create a macro in EXCEL that goes to a cell that has a text, and brings me a piece of this text. The problem is that the text has no pattern, only know that somewhere in this text will be…
-
0
votes1
answer314
viewsMacro Excel capture link redirects
It is possible to create a macro that copies the redirects I have on links in cells A1:A100 ? For example in the cell A1 have www.pplware.com, but when we open this url I am redirected to another…
-
0
votes1
answer725
viewsVBA Rowsource with variable
How do I place a variable spreadsheet in a Rowsource? I’m trying to concatenate with the last line but this giving error: Private Sub UserForm_Initialize() Dim plan As Worksheet Dim lin As Range Dim…
vbaasked 7 years, 9 months ago Anicesio Junior 21 -
0
votes0
answers123
viewsTextbox padding for textbox
I’m creating a project in VBA because I’m new in programming and I’m having difficulties in a part of the project. I have 3 textbox, two are user and password, the other I will load users separated…
-
0
votes0
answers27
viewsCPF mask in VBA
How to format the "CPF" field as shown below?…
-
0
votes0
answers241
viewsTabulation in excel
Hello I have a spreadsheet with some data on imports from the IRS. On this worksheet I do a tabulation of data, based on one of the columns that comes in this worksheet called "product description",…
-
0
votes0
answers112
viewsAdd Msflexgrid records via VBA textbox
How can I add records to Msflexgrid via a VBA textbox? I found a way to do it ( http://www.macoratti.net/gridedit.htm ) but for vb6, using screen.twipsperpixelx that does not exist in vba... Anyone…
-
0
votes0
answers129
viewsI need to select ranges concatenating Addresses in VBA
I have a sub in VBA that does several calculations to get into a range address list listaAddresses = "$A$1, $H$3,$V$1,$M$16,$A$21,$B$13,$H$88..... $T$44" With this list I need to select all ranges.…
-
0
votes1
answer44
viewsRoutines between different formats in VB
Good, I’m making a VBA application with 2 Forms. In Form1 I have a flexgrid that loads records from a database and in form 2 I have a textbox that introduces registration in the same database. What…
-
0
votes2
answers4697
viewsVBA: Filter multiple items of a Dynamic Table containing certain text
I am trying to run a code that shows all the items of a Dynamic Table that contain a certain text. I imagined that only using asterisks (*) before and after my keyword I could get results, but the…
-
0
votes1
answer3868
viewsUpdate all Dynamic Tables when selecting a Worksheet
I need all the dynamic tables in my spreadsheet to be updated every time I select one of my worksheets that serves as Dashboard. I used the most logical code, but I think something is missing, since…
-
0
votes1
answer388
viewsCopy cells to another Worksheet if they do not exist
In the Worksheet "BASE" I enter various customer data (NIF, name, address, telephone, email). I have a Worksheet "DATA" where you have a list of several clients. I need to create a button on the…
-
0
votes1
answer211
viewsWhen I refer more than one column using Formular1c1
good morning! I’m having problems when referencing more than one column in excel using VBA, for example: I make a selection of columns Stock! A:G and create the macro, and generate for me Stock!…
-
0
votes0
answers344
viewsUSERFORM: Move Listbox item up or down
I have a Listbox in a Userform that reflects a list of the order of display of the items in a Dashboard. I want the user to be free to change the order of these items by moving them down or up in…
-
0
votes1
answer64
viewsVBA Excel Reference Tools?
In Excel in VBA in Tools, Reference appears (MISSING: Adobe Acrobat 7.0 type library) where I can get this library and how do I include it in the list of references?
-
0
votes1
answer4369
viewsHow to concatenate variable with formula in Excel?
It is correct that I concatenate a variable to an Excel formula? Excel complains at concatenation closure: Sheets("FATURA").Select Dim variavel As Double variavel = InputBox("Digite Valor da Tarifa…
-
0
votes1
answer702
viewsFailure to generate TXT file by routine for printing in VBA/Excel
The form below refers to the code under VBA (Excel) presented below. This code refers to the printing of a spreadsheet on Excel by name "Imprint", as shown in the figure below. By the parameters…
-
0
votes1
answer770
viewsError 3706 Microsoft Visual Basic
I am making an application and when I went to program the VBA code to connect with Access Database which was my surprise gave the error: "Error 3706 Microsoft Visual Basic" The connection line is:…
-
0
votes1
answer1926
viewsCount the number of selected items in a Listbox
I have a list ListBox1 in a userform configured for multiple item selection. There is some function, statement, or way to return the number of selected items?
-
0
votes1
answer1105
viewsAuto complete when typing any part of the word
How can I self-cmplete the text when typing any part of an information inside the Listbox using VBA? Example: When typing the "Santos" all options containing that word will be listed / presented in…
-
0
votes1
answer28
viewsHow to implement in VB . ASPX the action of ENTER key as TAB?
I would like to know how to implement in the file’s onKeyDown event . aspx so that when pressed the ENTER key (code = 13) behaves like the TAB key (code = 9). This is generic so it can be reused on…