+ Reply to Thread
Results 1 to 7 of 7

VBA error with Set Range

  1. #1
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    314

    VBA error with Set Range

    Hi all,

    Using Excel 2007

    Code below I think it should select blank cells down Column E
    But the debug.print returns $E$1:$J$1
    What am I doing wrong?
    lngRowsTmp = 10526 which is correct

    thx
    w

    Please Login or Register  to view this content.
    Kind regards,
    w

    http://dataprose.org

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: VBA error with Set Range

    There's nothing wrong with that code but it will error if there are no blank cells in E1:E10526.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    314

    Re: VBA error with Set Range

    Thanks Norie,

    There are blanks, looks to be 15 or so.
    Any thoughts as so why debug.print returns an address of $E$1:$J$1?

    I expect something more like $E$4,$E$98,$E$1234,$E$5698,.....

    thx
    w

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: VBA error with Set Range

    Do you have any merged cells?

  5. #5
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    314

    Re: VBA error with Set Range

    No merged cells

    thx
    w

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: VBA error with Set Range

    I can't see why you would get that result.

    Can you attach a sample workbook?

  7. #7
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    314

    Re: VBA error with Set Range

    Thanks

    The data is proprietary
    I'll generate some random data later tonight and upload.

    thx
    w

+ 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