find last entry in a column Solved

  1.    #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
      My ComputerSystem Spec

  2. Try3's Avatar
    Posts : 2,022
    Windows 10 Home x64 and Pro x86
       #2

    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

    Code:
    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
    Denis
      My ComputerSystem Spec

  3.    #3

    Thankyou Denis that worked just fine for me.
    Len
      My ComputerSystem Spec


 

Related Threads
I have my old OS drive connected to a new drive and clean install. I'd like my GOM jumplist history back. Where is it located please? Google has failed me :confused: TIA
so im trying to remove Intel® Product Improvement Program (32-bit) from my control panel. Seriously intel?! Seriously!? Low and behold, no .cpl in the system32 folder. Also tried copy/pasting the name into group policy editor with and...
Solved date column in General Support
This morning I updated to the latest BitDefender and while doing so their instructions did not indicate to not select uninstall as the installer would complete this task automatically even though a message did pop up asking me to uninstall. I...
A few days ago I got a BSOD on my Windows 10 laptop. It happened on October 19 around 2:50 AM I believe. I wasn't really even doing anything on it at the time, I think I was doing something on my desktop computer next to it. My Windows 10 laptop...
Solved Column Bar problems. in General Support
I'm having a problem with the Column Bar in File Explorer. I like to show Backup Method in my backup folders along with Name, Date, etc. When I first installed Windows 10 it wasn't available in the drop down so I didn't think too much about it, but...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 01:53.
Find Us