New
#1
find last entry in a column
Hi all, I have a column and I want to find the last entry and add some text to the last entry offset 3 down.
Could you tell me how to do it please?.
Len
Hi all, I have a column and I want to find the last entry and add some text to the last entry offset 3 down.
Could you tell me how to do it please?.
Len
Len,
I assume you mean that you want VBA to do this.
- I have posted code for finding the last entry assuming the column concerned is column A.
- To get your offset you will need to manipulate LastRowUsed
- To add text you will have to manipulate that cell's .Value
DenisCode:Sub FindLastRowUsedDespiteAnyBlanks() Dim LastRowUsed 'this returns the last row used in column A [e.g. of Sheet1] even if there are blanks in some cells 'Sheets("Sheet1").Select 'May not be necessary ActiveSheet.Select If Cells(1, "A").Value = "" Then LastRowUsed = 0 Else LastRowUsed = Cells(Rows.Count, "A").End(xlUp).Row End If MsgBox LastRowUsed End Sub
Thankyou Denis that worked just fine for me.
Len