Posts by danieltakeshi • 3,960 points
212 posts
-
2
votes1
answer5785
viewsA: How to change a cell from "General" to "Number" and add a comma?
To format, the Property Range.Numberformat is used. Dim rng As Range Dim ws As Worksheet Set ws = ThisWorkbook.Sheets("Planilha1") Set rng = ws.Range("B:B", "E:E") With rng .NumberFormat =…
-
2
votes3
answers824
viewsA: Excel rounding value 7,256E+18
This is because Excel does the rounding after 15 digits as it uses the Floating-point arithmetic. Then the data should be shown as Text (String) Option 1 Format Cells to Text Manually by selecting…
-
0
votes1
answer5283
viewsA: VBA - Application definition or object definition error
I got the correct number of lines with this test code, some changes can be made for you to use. The code was made in Excel-VBA 7.1. From what I understood the spreadsheet already exists. Dim…
-
2
votes1
answer347
viewsA: How to separate Edit String in Excel
To solve the problem I went to study Regex (Regular Expression), but as I was learning, I couldn’t create a complex expression that would solve the problem. So I went to get the response in the…
-
0
votes1
answer1278
viewsA: Macro VBA for Exel - copy data from one sheet to another with one condition
If the Idprocesso needs to be exactly the same, you do not use the Like, because the same is usually used to get partial cards with wildcards. So, If Sheets("Dia18Set").Cells(contLinhasDia18Set, 1)…
-
1
votes2
answers421
viewsA: How to expand range of numbers with data?
Answer Extract Element First the extract element function is declared to extract space-separated elements " ", where each element has an index. Example.: 1 a 3 in cell A1, with the function…
-
0
votes4
answers33862
viewsA: How to search for values in column A that do not exist in column B?
The countif function can also be used, but as I know perform only in VBA, follows the code. That can be converted to Excel Function or be created as UDF. Dim ws As Worksheet Set ws =…
excelanswered danieltakeshi 3,960 -
2
votes2
answers1370
viewsA: Spreadsheet to discover the ZIP List City
The Range.Copy will be used as it is simple and easy. The Select should be avoided (English) in excel-vba. If you want to use .Select it is recommended to turn off the screen update before the code…
-
1
votes2
answers938
viewsA: Excel form - incompatible types
Your syntax of .Cells is incorrect, where the correct is .Cells(Linha, Coluna). There is no need to use only numbers, because lastrow = db.Cells(db.Rows.Count, "A").End(xlUp).Row also returns the…
-
1
votes1
answer1019
viewsA: How to identify a specific date in vba?
As @Bruno Coimbra spoke of interpolation, it is not possible. However it is possible to work with the date in format Long and then convert it to Date again. The functions used are those of type…
-
1
votes2
answers5617
viewsA: Excel VBA delete Listbox item
To select one item at a time This code removes the selected item ''' 'Remover item ''' 'Remove item selecionado da lista 1 For i = 0 To ListBox1.ListCount - 1 If ListBox1.Selected(i) Then…
-
1
votes2
answers2756
viewsA: Checking and Filling Excel Cells
Assuming the search data is in the C column of the Sheet(1) and You will search in the Sheet(2), this is code with the function . Find Dim Rng As Range, rng2 As Range ncell =…