+ Reply to Thread
Results 1 to 6 of 6

changing between worksheets

  1. #1
    Registered User
    Join Date
    12-17-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel XP
    Posts
    4

    changing between worksheets

    Hi, I have a spreadsheet which I have just set up. One function is to copy a row to a second obsolete worksheet and then delete from the main worksheet. This was working and has now stopped. I have put the code below, hope formatting works.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: changing between worksheets

    try something like
    Please Login or Register  to view this content.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    12-17-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel XP
    Posts
    4

    Re: changing between worksheets

    I am testing now, just having problems with other code so cant get to test. So basically you got rid of all the worksheet.select or .activate and used the with statement instead. I am assuming then that the correct worksheet will then always keep the focus. Do you still need some sort of Application.CutCopyMode = False to clear the clipboard?
    Last edited by JennyC64; 01-06-2010 at 11:46 PM. Reason: solved

  4. #4
    Registered User
    Join Date
    12-17-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel XP
    Posts
    4

    Re: changing between worksheets

    The numrows now returns 1 which is incorrect and then the copy fails with an automation error. So not having any luck with this and now heading home for the weekend, yay!!

  5. #5
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: changing between worksheets

    this should do it
    Please Login or Register  to view this content.
    Last edited by pike; 12-18-2009 at 01:42 AM. Reason: added .Range

  6. #6
    Registered User
    Join Date
    12-17-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel XP
    Posts
    4

    Smile Re: changing between worksheets

    Thanks, using this method of not activating the second work book worked well. I couldnt get the .copy to work but manually copied the few pieces of information I needed and got to work that way

+ 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