[Solved] Determining last active row [duplicate]

Your question is not “How to hide rows that have 0”, your code for that works already. Your question title should be How to find ActiveRange Asking the proper questions helps you find better solutions, quicker. Dim ws as WorkSheet: Set ws = Sheets(“Sheet1”) Dim lr as Long lr = ws.Cells(Rows.Count, “E”).End(xlUp).Row For each cell … Read more

[Solved] Cannot open excel files from Eclipse STS

I had chosen the wrong excel “tool” in eclipse to open xls files. Here is the solution : Eclipse > right click the xls file > open with > other > select “Microsoft Excel Binary Worksheet” > check “use it for all *.xls files” > ok. Now the excel files will be opened directly from … Read more

[Solved] merging two vba functions

Function findimage(Path As String, ImageList As String) Dim results Dim x As Long Dim dc ‘double comma Dim extension As String results = Split(ImageList, “,”) If Not Right(Path, 1) = “\” Then Path = Path & “\” For x = 0 To UBound(results) If Len(Dir(Path & results(x))) > 0 Then results(x) = True Else extension … Read more

[Solved] Excel VBA – Return separated data

If you want your result to be in Sheet2, then this code will do what you expect, it will check the number of Columns on Sheet1 and copy all of them into Sheet2: Sub foo() Dim LastRow As Long Dim LastCol As Long Dim ws As Worksheet: Set ws = Sheets(“Sheet1”) ‘change this to the … Read more

[Solved] EXCEL: How to separate words on Excel

There’s Text to Columns, using + as a delimiter. That’s probably the quickest way. Select the data, then go to Data –> Text to Columns. Choose “Delimited”, using a + delimiter. If you want, choose a destination (that’s optional, you can just click “Finish” which will overwrite the current data). Alternatively, you can use LEFT() … Read more

[Solved] Simple VBA code to open cells one after the other

Why would you want to do this? VBA doesn’t have a keyword that represents entering into a cell. You can select the cell like this though: Sub DoNotRun() Dim rng as range For Each rng In ThisWorkbook.Worksheets(“Sheet1”).range(“A:A”) rng.Select Next rng End Sub If you really need to simulate a double click — Worksheets have a … Read more

[Solved] VBA to ignore cell formating when adding a specific number using a userform

Since there is a single piece of code writing in column C:C, adapt it in the next way: Instead of: Sheets(“Sheet3”).Range(“C4”).Select Selection.Borders.Weight = xlThin ActiveCell.Value = “.” & TextBox3 Try this, please: If TextBox3.Text = “6” then Sheets(“Sheet3”).Range(“C4”).NumberFormat = “@” end if With Sheets(“Sheet3”).Range(“C4”) .Borders.Weight = xlThin .Value = “.” & TextBox3.Text End With 2 … Read more