Results 1 to 3 of 3

Range starts from first cell of a dynamic column

Threaded View

  1. #1
    Registered User
    Join Date
    10-01-2009
    Location
    Manassas, VA
    MS-Off Ver
    Excel 2007
    Posts
    86

    Range starts from first cell of a dynamic column

    I would like LastRow to start from the first cell of the input Column and count down.

    What I had didn't work

    Function AvgLastX(N As Integer, MyCol As String)
        Dim LastRow As Long
    
        LastRow = Range(Cells(1, MyCol)).End(xlDown).Row + 1
        
    AvgLastX = WorksheetFunction.Average(Range(Cells(LastRow, MyCol), Cells(LastRow - N, MyCol)))
    End Function
    Please help,

    NTB
    Last edited by NTB; 10-07-2010 at 08:38 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1