Results 1 to 5 of 5

When using the xlLastCell in VB it will go further than the last cell?

Threaded View

  1. #1
    Forum Contributor
    Join Date
    07-08-2009
    Location
    Missouri
    MS-Off Ver
    Excel 2003
    Posts
    183

    When using the xlLastCell in VB it will go further than the last cell?

    It has to do with the fact that I am putting stuff in and then deleting it. xlLastCell will go to where the end of the last cell where the information used to be that I had deleted was. If that makes since..

    I have figured out that if I save the workbook it will update and then xlLastCell will work just fine.. The problem is, that when I use that, it slows down the execution of the macro tremendously..

    Any ideas? Is there something else that will update the workbook besides Save?

    Here is my code as of now, with the ActiveWorkbook.Save in there.

        Sheets("Pending Approvals").Select
        ActiveWorkbook.Save    
        Sheets("Blank Form").Select
        Application.CutCopyMode = False
        ActiveWorkbook.Save    
        Rows("1:65").Select
        Selection.COPY
        Sheets("Pending Approvals").Select
        Range("A1").Select
        ActiveCell.SpecialCells(xlLastCell).Select
        Cells(ActiveCell.Row + 1, 1).Activate
        ActiveSheet.Paste
        ActiveWindow.SmallScroll Down:=33
    Thanks for the help!
    Last edited by mrgillus; 08-20-2009 at 11:33 AM. Reason: Lining up the information in the code box..

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