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-2017

Updated:  04/06/2017 20:31
This page added:  11 September 2011