+ Reply to Thread
Results 1 to 5 of 5

Unexpected results from CurrentRegion

  1. #1
    Registered User
    Join Date
    03-29-2011
    Location
    DC
    MS-Off Ver
    Excel 2007
    Posts
    2

    Unexpected results from CurrentRegion

    I have a workbook with many worksheets. The range of the worksheets is always A33:[any number of columns wide]33. What I need to do is copy the contents of each worksheet into a single worksheet, with each set of data appended to the right of previous.

    Here is the portion of code I am having problems with:
    Please Login or Register  to view this content.


    It functions exactly as expected, however CurrentRegion does not seem to grab the proper area from all worksheets. Despite this, when I test the code in the immediate window the selection is exactly as I would expect.

    Thoughts?

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Unexpected results from CurrentRegion

    What do you mean by the 'proper area'? The current region is what it is. If you have blank rows and columns they will not be included.

  3. #3
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Unexpected results from CurrentRegion

    Please Login or Register  to view this content.



  4. #4
    Registered User
    Join Date
    03-29-2011
    Location
    DC
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Unexpected results from CurrentRegion

    Quote Originally Posted by snb View Post
    Please Login or Register  to view this content.

    Thanks, that seems to have done the trick.

    I'm a little confused as to why this works as opposed to the previous method. What is the difference between using cells(1).CurrentRegion and Range("A1").CurrentRegion?

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Unexpected results from CurrentRegion

    Most of the time it's better to copy without the method 'copy'.

+ 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