Results 1 to 2 of 2

Thread: VBA/Excel finding cell query

  1. #1

    Thread Starter
    Hyperactive Member thebloke's Avatar
    Join Date
    May 2003
    Posts
    358

    VBA/Excel finding cell query

    Sorry to sound so dumb but this aint really my bag.

    How can I determine the last cell in a column in Excel and insert an auto total in the cell below, if you catch my drift?

    I'm sure it's a pretty straight forward thing but it's not something that I ever use.

    Cheers
    The Bloke
    www.blokeinthekitchen.com
    making cooking cool for blokes

  2. #2
    New Member
    Join Date
    Oct 2003
    Posts
    2
    The following function should return the last used cell in a given column.
    Code:
    Function LastUsedColumnCell(strCol As String) As Range
        Set LastUsedColumnCell = _
            Range("65536:65536").Cells(Columns(strCol).Column).End(xlUp)
    End Function
    For example LastUsedColumnCell("A").Select will select the last used cell in Column A.

    To enter a formula in the next cell below you could use :
    Code:
    LastUsedColumnCell("A").Offset(1, 0).Formula = "=[I]Formula/I] "
    Regards,

Posting Permissions

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



Click Here to Expand Forum to Full Width