+ Reply to Thread
Results 1 to 4 of 4

"do while" loop does not seem to recognize range object anymore

  1. #1
    Registered User
    Join Date
    12-10-2020
    Location
    Paris
    MS-Off Ver
    365
    Posts
    2

    "do while" loop does not seem to recognize range object anymore

    Hi, I try to resize a range according to some conditions through a "do while loop". Once arriving at the do loop instruction, it seems not to recognize the "rgnH" range anymore. The code is below, any idea of my error? Thanks a lot for your answer.

    Please Login or Register  to view this content.
    Last edited by mcarduner; 12-10-2020 at 03:07 AM.

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: "do while" loop does not seem to recognize range object anymore

    Administrative Note:

    mcarduner, Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,908

    Re: "do while" loop does not seem to recognize range object anymore

    You need to learn to use Option Explicit.

    You have rgnH versus rngH...
    Rory

  4. #4
    Registered User
    Join Date
    12-10-2020
    Location
    Paris
    MS-Off Ver
    365
    Posts
    2

    Re: "do while" loop does not seem to recognize range object anymore

    oups, need to change my glasses :-). Thanks very much and sorry for such a reading mistake.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 7
    Last Post: 01-11-2019, 07:58 PM
  2. [SOLVED] Copy cells from range "C3" to "F3" with loop and blank field
    By masterm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-16-2015, 01:03 PM
  3. "Object required" error with VBA loop rows deleting
    By JKWIN in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-22-2012, 09:31 AM
  4. "The "sheets" method from the "_Global" object have failed."
    By mankit87 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-08-2011, 08:53 AM
  5. Error msgs: "Object varible or with block variable not set"; "subscript out of range"
    By menyanthe in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-26-2009, 04:58 PM
  6. Recognize "formulas "result" as "typed data", through and through.
    By gandolff in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-13-2009, 01:30 PM
  7. [SOLVED] What is Error "Method "Paste" of object "_Worksheet" failed?
    By vat in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-17-2006, 04:10 PM

Tags for this Thread

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