When I want to find the last used cell value, I use: Dim last_row As Integer Dim LastRow As Long LastRow = Range("E4:E48").End(xlDown).Row Debug.Print LastRow I am getting the wrong output when ...
How can I use regular expressions in Excel and take advantage of Excel's powerful grid like setup for data manipulation? In-cell function to return matched pattern or replaced value in string. Sub t...
I would like to loop through the files of a directory using vba in Excel 2010. In the loop, I will need the filename, and the date at which the file was formatted. I have coded the following wh...
I am having a problem with excel crashing when i run VBA code on an excel sheet. I have some code to add a formula to a range of cells as follows: Private Sub Worksheet_Change(ByVal Target As Range) ...
I often see questions relating to Overflow errors with vba. My question is why use the integer variable declaration instead of just defining all numerical variables (excluding double etc.) as long? ...
This script works fine when I'm viewing the "Temp" sheet. But when I'm in another sheet then the copy command fails.. It gives a "Application-defined or object-defined error" Sheets("Temp").Range(Cel...
Does VBA have dictionary structure? Like key<>value array?
Not really a question, but posting this for comments because I don't recall seeing this approach before. I was responding to a comment on a previous answer, and tried something I'd not attempted befo...
I have some Excel worksheets that use ActiveX checkboxes to control certain activity. They worked recently but today started to give errors. I was alerted to this by a colleague, but it was still wo...
Is there something that I need to reference? How do I use this: Dim fso As New FileSystemObject Dim fld As Folder Dim ts As TextStream I am getting an error because it does not recognize these obje...