Posts by Paulo Vieira • 469 points
27 posts
-
2
votes3
answers84
viewsA: Copy between strings inside Python lists
Case to lista = ['a', 'b', 'c', 'd', 'e'] is not mandatory the following code repeats the letter found until it finds a new letter nova = [] for x in coluna: if x.isnumeric(): nova.append(letra)…
-
0
votes1
answer67
viewsA: Why doesn’t my code make sense?
If your idea is to initialize the variables register, active and logged in 0 then change cadastro, ativo, logado=0;for cadastro = ativo = logado = 0; a look at this topic on initialization of…
-
0
votes1
answer70
viewsA: How to run a python script using VBA
Try this: RetVal = Shell(PythonPath & MyFilePath) Or if the Python script is in the same directory as the Excel workbook, you can try: RetVal = Shell(PythonPath & ActiveWorkBook.Path &…
-
0
votes4
answers177
viewsA: Insert names to a list depending on their value
Using List Comprehensions (List Comprehension) lista = ['Bia'] #considerando que cada nome custe 10 valor = input('Valor que deseja doar: ') qtde = int((int(valor) / 10)) nome = input('Qual o seu…
-
1
votes1
answer157
viewsA: Conditional completion
Double click on Planilha1 (Planilha1), as in the image. You can change, in your case, but just do this procedure in the spreadsheet where you want the code to be executed. Put the following code:…
-
1
votes2
answers551
viewsA: Excel with slow macro
Jose good afternoon, follow the following code, replying to the comment of Bruno Fonseca, do not use Select. I hope it helps, it is a simple code that references directly to your data source,…
-
2
votes1
answer2411
viewsA: Import data from a txt to EXCEL spreadsheet via VBA
Henrique good afternoon! Hope it helps, run the sub import_file() Sub importar_arquivo() Application.ScreenUpdating = False importaArquivo End Sub Private Function importaArquivo() Dim arquivo As…
-
0
votes3
answers1916
viewsA: Find WHOLE word in a C string
#include <stdio.h> #include <string.h> int main() { char str[] = "Ola tudo bem, vamos jogar dados"; char search[] = "dado"; char *ptr = strstr(str, search); if (ptr != NULL) /* Substring…
canswered Paulo Vieira 469 -
2
votes1
answer58
viewsA: How to generate a report from a recorded macro?
Application.Workbooks("<nome da sua pasta de trabalho com extensão>").Activate You can also delete this, is the recording of the mouse scroll. ActiveWindow.ScrollColumn = 21…
-
0
votes1
answer357
viewsA: Macro to join two Excel columns
Good morning, follow the code. Just select the first row of the columns you want to concatenate. Run with two columns only. Option Explicit Sub concatena_colunas() Dim coluna_01 As Long Dim…
-
0
votes1
answer204
viewsA: VBA Listbox Automatic Filter
Issac changed from that; .List(linhalistbox, 0) = Planilha3.Cells(linha, 1) .List(linhalistbox, 1) = Planilha3.Cells(linha, 2) .List(linhalistbox, 2) = Planilha3.Cells(linha, 3) .List(linhalistbox,…
-
1
votes1
answer562
viewsA: Copy the contents of a spreadsheet and paste into a new one using VBA
Vinicio Lima, good afternoon. For this code to work correctly you must leave the various worksheets (workbooks) and the worksheet specifies (workbook) of destination in the same directory. Run the…
-
1
votes1
answer32
viewsA: Duplicate spreadsheet
In the two-click project tree in Stables. Then at the top of the combobox from the left select Workbook, it is to be expected that automatically appears this: Private Sub Workbook_Open() End Sub If…
-
0
votes3
answers869
viewsA: Factorial in C, beginning of programming
#include <stdio.h> int main() { int n, i; unsigned long long factorial = 1; printf("Entre com um numero inteiro: "); scanf("%d",&n); // Exibi mensagem de erro caso valor de entrada for…
-
1
votes1
answer124
viewsA: I need to compare the value of the last filled cell with the antepenultimate
Thays hope the code snippet helps If linha >= 2 And Range("D" & linha).Value <> Empty Then 'inicia comparação a partir da linha 2, já que a comparação é entre a linha atual e a atual-1…
-
0
votes1
answer281
viewsA: how to populate a site field using excel vba
Clebson would it be possible to put the link of the site in question? Or try IE.document.all.Item("stk bs-Stake_TextBox").Value = "<valor desejado>"
-
1
votes1
answer193
viewsA: Vba web scraping
Good morning Juny hope the code below helps First step is to configure references. in the VBA IDE go to Tools > References then check the options: Microsoft Internet Controls and Microsoft HTML…
vbaanswered Paulo Vieira 469 -
1
votes1
answer76
viewsA: VBA- Add entire row in a Listbox
I hope I helped, returns the line number and not all the line content, since the function Entirerow does not offer this possibility. I suggest a fine return of the number of the line in which it…
-
1
votes1
answer2720
viewsA: VBA - How to send specific cells of a spreadsheet in the body of an email
Hello Ecodata I hope to help you, I made small adjustments and tested and worked! Follow the code snippet you need to change. Sheets("Demandas").Select Set intervalo =…
-
0
votes3
answers132
viewsA: Excel vba - bug when inserting several cells at the same time
Edie good night, follows the first code, relatively simple. I hope it meets your expectation. This first interpretation does not take into account a column insertion by selecting the entire column…
-
1
votes1
answer924
viewsA: VBA to fill empty cell
Good afternoon to you, Bruno! Follow the code that will probably start to help you, I confess that it was not very clear what you asked but already served to start the lines below. I hope it helps…
-
4
votes1
answer7609
viewsA: How to acquire information from the IEC (Investor’s Electronic Channel)?
Sportacub good night, has yes. Using Excel VBA. I am also user, beginner, CEI. Maybe help that I will give you is partial, enter the CEI with VBA but I hope with this we start a learning journey…
-
2
votes1
answer7859
viewsA: Increase list source in Data Validation
Leandro unfortunately, you cannot change the font size or style in a drop-down list created using data validation. You can style the text in a combo box, however you can use an Activex control combo…
-
0
votes2
answers218
viewsA: Generate Tables and insert formulas with variable range (VBA)
Their doubts were not clear, could make available some data? What is the criterion for 'Countifs' ? in the correction below adopted as criterion ">10" Range("C4").Value =…
vbaanswered Paulo Vieira 469 -
1
votes1
answer2777
viewsA: Consolidate data from multiple tabs into one (same workbook)
Sub juntarfim() Application.ScreenUpdating = False 'desativa atualização de…
excel-vbaanswered Paulo Vieira 469 -
0
votes4
answers6070
viewsA: Excel VBA - Runtime Error '13': Incompatible Types
I did tests with your code and nothing abnormal, follow what I did. Apparently it’s working properly. Already tried to revise the logic, what expected result? Entrances Code Sub tst() LastRow = 18…
-
1
votes1
answer569
viewsA: Problems to close another spreadsheet by VBA
With this code snippet you can close any workbook. Dim wb As Workbook 'nesse caso eu atribuiria uma referência a variável wb Set wb = Application.Workbooks.Open("<caminho\seuArquivo.xlsx>")…