<link rel="stylesheet" type="text/css" href="http://excelvbamacro.com/wp-content/plugins/wp-secure-by-sitesecuritymonitorcom/css/hiddenloginerror.css" /> <script type="text/javascript">document.getElementById('wp-version-message').innerHTML = '';</script> <?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" > <channel><title>Comments on: How To Find the Last Row That Contain Data in Excel?</title> <atom:link href="http://excelvbamacro.com/how-to-find-the-last-row-that-contain-data-in-excel/feed/" rel="self" type="application/rss+xml" /><link>http://excelvbamacro.com/how-to-find-the-last-row-that-contain-data-in-excel/</link> <description>Excel VBA Macro Tutorial and Examples</description> <lastBuildDate>Tue, 25 May 2010 20:23:08 +0800</lastBuildDate> <generator>http://wordpress.org/?v=125</generator> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>By: Adam</title><link>http://excelvbamacro.com/how-to-find-the-last-row-that-contain-data-in-excel/comment-page-1/#comment-436</link> <dc:creator>Adam</dc:creator> <pubDate>Mon, 24 May 2010 17:11:24 +0000</pubDate> <guid isPermaLink="false">http://localhost/excelvbamacro/?p=7#comment-436</guid> <description>I want to add a row with a condtion if in column a the last date is not current date then insert date can any one help me</description> <content:encoded><![CDATA[<p>I want to add a row with a condtion<br /> if in column a the last date is not current date then insert date<br /> can any one help me</p> ]]></content:encoded> </item> <item><title>By: Poer</title><link>http://excelvbamacro.com/how-to-find-the-last-row-that-contain-data-in-excel/comment-page-1/#comment-299</link> <dc:creator>Poer</dc:creator> <pubDate>Mon, 08 Jun 2009 09:09:09 +0000</pubDate> <guid isPermaLink="false">http://localhost/excelvbamacro/?p=7#comment-299</guid> <description>Thanks Nuovella &gt;:D&lt;</description> <content:encoded><![CDATA[<p>Thanks Nuovella >:D<</p> ]]></content:encoded> </item> <item><title>By: Mike</title><link>http://excelvbamacro.com/how-to-find-the-last-row-that-contain-data-in-excel/comment-page-1/#comment-284</link> <dc:creator>Mike</dc:creator> <pubDate>Wed, 22 Apr 2009 14:25:19 +0000</pubDate> <guid isPermaLink="false">http://localhost/excelvbamacro/?p=7#comment-284</guid> <description>Thanks, Nuovella!</description> <content:encoded><![CDATA[<p>Thanks, Nuovella!</p> ]]></content:encoded> </item> <item><title>By: anand</title><link>http://excelvbamacro.com/how-to-find-the-last-row-that-contain-data-in-excel/comment-page-1/#comment-277</link> <dc:creator>anand</dc:creator> <pubDate>Tue, 31 Mar 2009 14:21:32 +0000</pubDate> <guid isPermaLink="false">http://localhost/excelvbamacro/?p=7#comment-277</guid> <description>Can anyone please let me know whether it is possible to take the values from workbook B to workbook A without opening workbook B?</description> <content:encoded><![CDATA[<p>Can anyone please let me know whether it is possible to take the values from workbook B to workbook A without opening workbook B?</p> ]]></content:encoded> </item> <item><title>By: Vera</title><link>http://excelvbamacro.com/how-to-find-the-last-row-that-contain-data-in-excel/comment-page-1/#comment-264</link> <dc:creator>Vera</dc:creator> <pubDate>Tue, 10 Feb 2009 01:40:23 +0000</pubDate> <guid isPermaLink="false">http://localhost/excelvbamacro/?p=7#comment-264</guid> <description>Correction I need vba to find the last cell in column A that is blank (&quot;&quot;) but is not empty.</description> <content:encoded><![CDATA[<p>Correction<br /> I need vba to find the last cell in column A that is blank (&#8220;&#8221;) but is not empty.</p> ]]></content:encoded> </item> <item><title>By: Vera</title><link>http://excelvbamacro.com/how-to-find-the-last-row-that-contain-data-in-excel/comment-page-1/#comment-263</link> <dc:creator>Vera</dc:creator> <pubDate>Tue, 10 Feb 2009 01:28:29 +0000</pubDate> <guid isPermaLink="false">http://localhost/excelvbamacro/?p=7#comment-263</guid> <description>Please I need vba to find the last cell in column A that is not blank but is not empty. I have formulas from A14 to A35 that returns a number or &quot;&quot;. I need the code to find the last cell in range A14:A35 that has a number. All that I found on the net will return A35 because it has a formula in it, even if the result is &quot;&quot;.Thank you.</description> <content:encoded><![CDATA[<p>Please I need vba to find the last cell in column A that is not blank but is not empty. I have formulas from A14 to A35 that returns a number or &#8220;&#8221;. I need the code to find the last cell in range A14:A35 that has a number. All that I found on the net will return A35 because it has a formula in it, even if the result is &#8220;&#8221;.</p><p>Thank you.</p> ]]></content:encoded> </item> <item><title>By: Nuovella</title><link>http://excelvbamacro.com/how-to-find-the-last-row-that-contain-data-in-excel/comment-page-1/#comment-50</link> <dc:creator>Nuovella</dc:creator> <pubDate>Sat, 13 Dec 2008 13:55:22 +0000</pubDate> <guid isPermaLink="false">http://localhost/excelvbamacro/?p=7#comment-50</guid> <description>&lt;pre class=&quot;brush:vb&quot;&gt; &#039; &#039;======================================================= &#039; Find the last used Cell on a Worksheet - Robust version 3 by Nuovella &#039; This the simplest and best - it is robust against any type of hidden cells, &#039; hidden rows, hidden columns or filters &#039;======================================================= Function FindLastCell() As StringWith ActiveSheet.UsedRange MyUsedRange = .Address nUsedRows = .Rows.Count nUsedCols = .Columns.Count lastRow = .Rows(nUsedRows).Row lastCol = .Columns(nUsedCols).Column End With FindLastCell = Cells(lastRow, lastCol).AddressEnd Function &lt;/pre&gt;</description> <content:encoded><![CDATA[<pre class="brush:vb">
'
'=======================================================
' Find the last used Cell on a Worksheet - Robust version 3 by Nuovella
' This the simplest and best - it is robust against any type of hidden cells,
' hidden rows, hidden columns or filters
'=======================================================
Function FindLastCell() As String

  With ActiveSheet.UsedRange
            MyUsedRange = .Address
            nUsedRows = .Rows.Count
            nUsedCols = .Columns.Count
            lastRow = .Rows(nUsedRows).Row
            lastCol = .Columns(nUsedCols).Column
    End With
    FindLastCell = Cells(lastRow, lastCol).Address

End Function
</pre>]]></content:encoded> </item> <item><title>By: Nuovella</title><link>http://excelvbamacro.com/how-to-find-the-last-row-that-contain-data-in-excel/comment-page-1/#comment-49</link> <dc:creator>Nuovella</dc:creator> <pubDate>Sat, 13 Dec 2008 11:51:34 +0000</pubDate> <guid isPermaLink="false">http://localhost/excelvbamacro/?p=7#comment-49</guid> <description>&lt;pre class=&quot;brush:vb&quot;&gt; &#039; &#039;============================================ &#039;Find the last used Cell on a Worksheet - Robust version2 &#039;============================================ Function FindLastCell() As StringDim afRange As String, afRangeNrows As Long, afRangeNcols As Long Dim afRangeLastRow As Variant, afRangeLastCol As Variant Dim lastRow As Variant, lastCol As VariantlastRow = Cells.SpecialCells(xlCellTypeLastCell).Row lastCol = Cells.SpecialCells(xlCellTypeLastCell).Column If (ActiveSheet.AutoFilterMode = True) Then With ActiveSheet.AutoFilter.Range afRange = .Address afRangeNrows = .Rows.Count afRangeNcols = .Columns.Count afRangeLastRow = .Rows(afRangeNrows).Row afRangeLastCol = .Columns(afRangeNcols).Column End WithIf (lastRow &lt; afRangeLastRow) Then lastRow = afRangeLastRow End IfIf (lastCol &lt; afRangeLastCol) Then lastCol = afRangeLastCol End If End If &#039;filter mode is on MsgBox afRange &#039;MsgBox Cells(LastRow, LastCol).Address FindLastCell = Cells(lastRow, lastCol).AddressEnd Function &lt;/pre&gt;</description> <content:encoded><![CDATA[<pre class="brush:vb">
'
'============================================
'Find the last used Cell on a Worksheet - Robust version2
'============================================
Function FindLastCell() As String

    Dim afRange As String, afRangeNrows As Long, afRangeNcols As Long
    Dim afRangeLastRow As Variant, afRangeLastCol As Variant
    Dim lastRow As Variant, lastCol As Variant

    lastRow = Cells.SpecialCells(xlCellTypeLastCell).Row
    lastCol = Cells.SpecialCells(xlCellTypeLastCell).Column

    If (ActiveSheet.AutoFilterMode = True) Then
        With ActiveSheet.AutoFilter.Range
            afRange = .Address
            afRangeNrows = .Rows.Count
            afRangeNcols = .Columns.Count
            afRangeLastRow = .Rows(afRangeNrows).Row
            afRangeLastCol = .Columns(afRangeNcols).Column
        End With

        If (lastRow &lt; afRangeLastRow) Then
            lastRow = afRangeLastRow
         End If

        If (lastCol &lt; afRangeLastCol) Then
            lastCol = afRangeLastCol
        End If
    End If 'filter mode is on
    MsgBox afRange
    'MsgBox Cells(LastRow, LastCol).Address
    FindLastCell = Cells(lastRow, lastCol).Address

End Function
</pre>]]></content:encoded> </item> <item><title>By: Nuovella</title><link>http://excelvbamacro.com/how-to-find-the-last-row-that-contain-data-in-excel/comment-page-1/#comment-48</link> <dc:creator>Nuovella</dc:creator> <pubDate>Sat, 13 Dec 2008 11:40:09 +0000</pubDate> <guid isPermaLink="false">http://localhost/excelvbamacro/?p=7#comment-48</guid> <description>&lt;pre class=&quot;brush:vb&quot;&gt; &#039; &#039;========================================== &#039;Find the last used Cell on a Worksheet - Robust version &#039;========================================== Function FindLastCell() As StringDim afRange As String, afRangeNrows As Long, afRangeNcols As Long Dim afRangeLastRow As Variant, afRangeLastCol As Variant Dim lastRow As Variant, lastCol As VariantlastRow = Cells.SpecialCells(xlCellTypeLastCell).Row lastCol = Cells.SpecialCells(xlCellTypeLastCell).Column If (ActiveSheet.FilterMode = True) Then With ActiveSheet.AutoFilter.Range afRange = .Address afRangeNrows = .Rows.Count afRangeNcols = .Columns.Count afRangeLastRow = .Rows(afRangeNrows).Row afRangeLastCol = .Columns(afRangeNcols).Column End WithIf (lastRow &lt; afRangeLastRow) Then lastRow = afRangeLastRow End IfIf (lastCol &lt; afRangeLastCol) Then lastCol = afRangeLastCol End If End If &#039;filter mode is on &#039;MsgBox Cells(LastRow, LastCol).Address FindLastCell = Cells(lastRow, lastCol).AddressEnd Function &lt;/pre&gt;</description> <content:encoded><![CDATA[<pre class="brush:vb">
'
'==========================================
'Find the last used Cell on a Worksheet - Robust version
'==========================================
Function FindLastCell() As String

    Dim afRange As String, afRangeNrows As Long, afRangeNcols As Long
    Dim afRangeLastRow As Variant, afRangeLastCol As Variant
    Dim lastRow As Variant, lastCol As Variant

    lastRow = Cells.SpecialCells(xlCellTypeLastCell).Row
    lastCol = Cells.SpecialCells(xlCellTypeLastCell).Column

    If (ActiveSheet.FilterMode = True) Then
        With ActiveSheet.AutoFilter.Range
            afRange = .Address
            afRangeNrows = .Rows.Count
            afRangeNcols = .Columns.Count
            afRangeLastRow = .Rows(afRangeNrows).Row
            afRangeLastCol = .Columns(afRangeNcols).Column
        End With

        If (lastRow &lt; afRangeLastRow) Then
            lastRow = afRangeLastRow
         End If

        If (lastCol &lt; afRangeLastCol) Then
            lastCol = afRangeLastCol
        End If
    End If 'filter mode is on

    'MsgBox Cells(LastRow, LastCol).Address
    FindLastCell = Cells(lastRow, lastCol).Address

End Function
</pre>]]></content:encoded> </item> <item><title>By: Don</title><link>http://excelvbamacro.com/how-to-find-the-last-row-that-contain-data-in-excel/comment-page-1/#comment-14</link> <dc:creator>Don</dc:creator> <pubDate>Thu, 30 Oct 2008 20:24:04 +0000</pubDate> <guid isPermaLink="false">http://localhost/excelvbamacro/?p=7#comment-14</guid> <description>TQ&#039;s method assumes that the most rows possible is 65,536 rows.  In Office 2007 this restriction was lifted.  A revised method which works will all versions of office is:Function LastRow(Col As String) LastRow = Range(Col &amp; Rows.Count).End(xlUp).Row End Function</description> <content:encoded><![CDATA[<p>TQ&#8217;s method assumes that the most rows possible is 65,536 rows.  In Office 2007 this restriction was lifted.  A revised method which works will all versions of office is:</p><p>Function LastRow(Col As String)<br /> LastRow = Range(Col &amp; Rows.Count).End(xlUp).Row<br /> End Function</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 8/25 queries in 0.336 seconds using disk

Served from: excelvbamacro.com @ 2010-07-30 19:41:40 -->