Posts by Leandro Felipe Moreira • 423 points
27 posts
-
2
votes3
answers4302
viewsQ: Picking 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…
-
0
votes1
answer41
viewsA: Field of view of surveillance cameras in Excel
Hello, You can use the formula SE: I made your table and noticed that each camera has a range, but the ranges cross, so I inserted in the cells that the ranges cross the following formula: =SE($D$6…
-
1
votes1
answer117
viewsA: How to copy the validation rules in vba?
Hello, If I understand correctly, you want to copy the data validation, but the data validation can not be copied, but you can add one like this: Range("B4").Validation.Add…
vbaanswered Leandro Felipe Moreira 423 -
4
votes1
answer229
viewsQ: Check the number of copies that have been printed
Hello, I have a table that when printed generates a record in a txt telling the user who printed, on which machine, on which printer, which document was and when. But I would also like to register…
-
3
votes1
answer7859
viewsQ: Increase list source in Data Validation
Hello, I have a field of my spreadsheet that has a list by data validation, I would like to know how to increase this source, leaving it more visible. NOTE: Without the zoom scheme. That is the…
-
7
votes1
answer27154
viewsA: Is it possible to comment several lines at once in VBA?
It exists, but it doesn’t work like in C#, it’s a toolbar, you activate it like this: Go to view > Toolbars > Edit To comment, you select the code you want to leave in comment and click on the…
vbaanswered Leandro Felipe Moreira 423 -
2
votes2
answers691
viewsA: Excel: Create scale with 2 known points
So you have two scales: Dots: 25 Pontos - 99 Pontos, sendo seu centro 66 Pontos e seu range 74 Pontos (99 - 25 = 74) Percentage: 12% - 54 %, sendo seu centro 33% e seu range 42% (54 - 12 = 42) Now…
-
1
votes1
answer107
viewsA: VBA - Paste Reports into a Determined Sheet
Natalia, Try to change that part: Range("A2","R16").Copy Active.Sheet("nome da sheet") Range(A5,R65).pastespecial For: Range("A2:R16").Copy Sheets("nome da sheet").Range("A5").Paste…
-
0
votes1
answer607
viewsA: How to run macro with locked project?
So, talking to @Evert, I sent him my spreadsheet. We found that there was indeed a macro that altered the code, so there really was an error. Now the spreadsheet is working perfectly.
-
0
votes1
answer607
viewsQ: How 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
votes2
answers224
viewsA: Check the end of the song and run macro
I found a good answer too: Private Sub WindowsMediaPlayer1_StatusChange() If WindowsMediaPlayer1.playState = wmppsMediaEnded Then CAMPAINHA.Visible = True VOZA1.Visible = True VOZALEA1.Visible =…
-
1
votes2
answers224
viewsQ: Check the end of the song and run macro
Hello, I am making a virtual sound table for an event and would like to give the effect of clicking the button. I am making mega simple, but I need the button to be pressed while the music plays and…
-
0
votes1
answer134
viewsQ: Calling 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 Leandro Felipe Moreira 423 -
3
votes1
answer328
viewsQ: Check module name via VBA
Hello, I need to check the name of a module to change it later. The name of the module changes a lot, depending on each document,and not to run all possible names, because it would take too long.…
vbaasked Leandro Felipe Moreira 423 -
0
votes2
answers48
viewsA: How to add spaces before a number?
Hi, so if it’s only for up to 3 characters, I think it’s much simpler to write 3 if’s like this: Sub numeros2() Dim numero Rng = Columns(1).End(xlDown).Row For i = 1 To Rng numero = Cells(i, 1) If…
-
0
votes2
answers1586
viewsA: Apply conditional formatting individually to each sheet line
Use the filter like this: 1.Goes in data: Select the title cell and press Filter: Select the date in question and the city you want: Selects filter cells and paints:…
-
1
votes1
answer831
viewsA: How to make a loop "for each" in column P up to the last row filled in VBA?
Sub teste() rng = Columns(16).End(xlDown).Row MsgBox rng For i = 1 To rng If Cells(i, 16).Value > "0" And Cells(i, 16).Value <= "100" Then Range("U2").Select ActiveCell.FormulaR1C1 =…
-
-1
votes2
answers24244
viewsQ: Handle Google Chrome with VBA
I’m creating a code that enters my company’s online system, but it can only be accessed by Google Chrome. The code to open Chrome is this: Sub Chrome() Dim GC As Object Dim WebUrl As String Dim…
-
0
votes2
answers2049
viewsA: VBA Code Adaptation to fetch photos from a folder
All your files are passing through here: If imagem <> "" Then If Dir(imgpasta + imagem) <> "" Then ActiveSheet.Shapes.AddPicture imgpasta + imagem, True, True, imgleft, imgtop, imgwidth,…
-
0
votes1
answer193
viewsA: Change Destination of a File Shortcut with VBA
I found the answer: NOTE: It is necessary to activate the Reference: Microsoft Shell Constrols And Automation Public Sub Change_Shortcut() Dim shell As Shell32.shell Dim folder As Shell32.folder Dim…
-
1
votes1
answer2259
viewsA: Excel vba: Saving data from a spreadsheet in . txt format
If you don’t mind that these names don’t enter your txt you can simply add at the beginning of the code: On Error Resume Next If this is not the case, try to review the method you are using to write…
-
1
votes1
answer193
viewsQ: Change Destination of a File Shortcut with VBA
I am changing the name of several worksheets at the same time, but some of them have shortcuts, and in the middle of the change I want the shortcuts to follow this change. Sub changeTargetPath() Set…
-
0
votes3
answers13786
viewsA: VBA: Use Excel to rename files in a folder
Name "Caminho\nome do arquivo.pdf" as "Caminho\nomedoarquivo.pdf" Ai just use variables and adapt to your code.
-
2
votes1
answer620
viewsA: VBA how to find the specific name of a spreadsheet and impute data in it
If both worksheets are open you can use one Workbooks("Nome da planilha.xlsx").Worksheets("Nome da Planilha").Cells(x,y) to look inside the other, of course, you’ll have to use other structures, but…
vbaanswered Leandro Felipe Moreira 423 -
0
votes1
answer89
viewsA: Add code to the Workbook using a macro
I found the answer. Set WECodeMod2 = ActiveWorkbook.VBProject.VBComponents("EstaPasta_de_trabalho").CodeModule Open "c:\CAMINHO\DO\ARQUIVO.txt" For Input As #2 Line_1 = 0 Do Until EOF(2) Line Input…
-
2
votes2
answers1102
viewsQ: Enter 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…
-
0
votes1
answer89
viewsQ: Add code to the Workbook using a macro
I have a code that records who prints the document, but I have a thousand documents and I have to enter the code, I already have the code to put modules, but I need one to put in the workbook to…