+ Reply to Thread
Results 1 to 4 of 4

Basic VBA Question with Array

  1. #1
    SITCFanTN
    Guest

    Basic VBA Question with Array

    I have a workbook with a dozen or so sheets. I'd like to add code to my
    existing macro to state when the sheet tab is clicked, the sheet displays at
    the bottom of the page, not the top. The reason for this is each of the
    sheets has a total at the bottom of the page and I'd like to be able to view
    that immediately. I can't specific a specific cell because I download a
    report each day so the last row of each sheet varies each day. I'm thinking
    this is simple, but I haven't been able to figure it out yet. Thanks for your
    help.

  2. #2
    Registered User
    Join Date
    10-28-2003
    Posts
    21
    try
    Cells.SpecialCells(xlCellTypeLastCell).Activate

  3. #3
    Steve Yandl
    Guest

    Re: Basic VBA Question with Array

    I'm not sure you will find it simple to add code to your existing macro to
    get what you want but you could add code to the workbook that would do what
    I think you want.

    Private Sub Workbook_SheetActivate(ByVal Sh As Object)
    Dim intRowCnt As Integer
    intRowCnt = ActiveSheet.UsedRange.Rows.Count
    ActiveSheet.Cells(intRowCnt, 1).Select
    End Sub



    Steve Yandl



    "SITCFanTN" <[email protected]> wrote in message
    news:[email protected]...
    >I have a workbook with a dozen or so sheets. I'd like to add code to my
    > existing macro to state when the sheet tab is clicked, the sheet displays
    > at
    > the bottom of the page, not the top. The reason for this is each of the
    > sheets has a total at the bottom of the page and I'd like to be able to
    > view
    > that immediately. I can't specific a specific cell because I download a
    > report each day so the last row of each sheet varies each day. I'm
    > thinking
    > this is simple, but I haven't been able to figure it out yet. Thanks for
    > your
    > help.




  4. #4
    SITCFanTN
    Guest

    Re: Basic VBA Question with Array

    THanks Steve, this works great, I added it to the bottom of each sheets page
    setup sub. I appreciate your help, thank you and have a great holiday.

    "Steve Yandl" wrote:

    > I'm not sure you will find it simple to add code to your existing macro to
    > get what you want but you could add code to the workbook that would do what
    > I think you want.
    >
    > Private Sub Workbook_SheetActivate(ByVal Sh As Object)
    > Dim intRowCnt As Integer
    > intRowCnt = ActiveSheet.UsedRange.Rows.Count
    > ActiveSheet.Cells(intRowCnt, 1).Select
    > End Sub
    >
    >
    >
    > Steve Yandl
    >
    >
    >
    > "SITCFanTN" <[email protected]> wrote in message
    > news:[email protected]...
    > >I have a workbook with a dozen or so sheets. I'd like to add code to my
    > > existing macro to state when the sheet tab is clicked, the sheet displays
    > > at
    > > the bottom of the page, not the top. The reason for this is each of the
    > > sheets has a total at the bottom of the page and I'd like to be able to
    > > view
    > > that immediately. I can't specific a specific cell because I download a
    > > report each day so the last row of each sheet varies each day. I'm
    > > thinking
    > > this is simple, but I haven't been able to figure it out yet. Thanks for
    > > your
    > > help.

    >
    >
    >


+ Reply to Thread

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