troubleshooting Question

Get last column with data from a certain row upwards

Avatar of av8orct
av8orct asked on
Microsoft Excel
5 Comments1 Solution406 ViewsLast Modified:
I've been trying to get the last column with data in my spreadsheet.

However, what I want to do is to start at a certain row and move upwards. Most of the code I've found looks at the entire spreadsheet.

I am using the below code to find the row to start at:

    'need to find last row of data from manifest (not resources)
    
    last_row = Cells.SpecialCells(xlCellTypeLastCell).row

     For a = last_row To 1 Step -1
     
        Set current_cell = wksht.Cells(a, 2)

        If Len(current_cell.Value) > 0 Then
            
            end_row = a
            Exit For
            
        End If
    
    Next a
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros