Excel VBA

css navigation by Css3Menu.com

Getting Position and Rows

My company is still using Excel 2003 until the end of the year. I’m reading the rows up from 65,500 to find the last used.

The section where I am looking for data contains formulas but I only want cells with a value.

    Cells(1, 1).Select
    LastCol = Selection.End(xlToRight).Column    'LAST COLUM
    LastRow = Range("A65000").End(xlUp).Row    'LAST ROW
    For Z = LastRow To 2 Step -1                    'Find last
        If Cells(Z, LastCol).Value > 0.0001 Then    'find real data not formula
            LastDataRow = Cells(Z, LastCol).Row     'set true bottom
            Exit For
        End If
    Next Z
    Range(Cells(2, 1), Cells(LastDataRow, LastCol)).Select  'Select range
    Selection.Copy                  'copy


© 2011-2024

Updated:  01/23/2024 13:34
This page added:  11 September 2011