+ Reply to Thread
Results 1 to 3 of 3

rows not hiding VBA

  1. #1
    Registered User
    Join Date
    09-16-2010
    Location
    spain
    MS-Off Ver
    Excel 365
    Posts
    14

    rows not hiding VBA

    Hi there!

    I have a problem as rows which should hide are not hiding.

    The code is the following (it is part of a much bigger program):

    For b = 13 To 54
    Select Case b
    Case 13 To 22, 30 To 33, 38 To 41, 46 To 49, 52 To 54
    If Cells(b, 1) = "" Then Cells(b, 1).EntireRow.Hidden = True
    End Select
    Next b

    The strange thing is if I set a breakpoint in the line where the for next loop begins, run the sub and then keep going forward pressing F8 the rows are being hidden correctly. When I let the sub proceed till end it they stay hidden and everything is allright.

    But if I let the program work completely by itself without breakpoint, the rows are not being hidden.

    I am really losing a lot of time with this now and see no error in the code....

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

    Re: rows not hiding VBA

    Administrative Note:

    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.)
    If posting code please use code tags, see here.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,630

    Re: rows not hiding VBA

    As already requested, please add Code Tags to your OP.

    It would also help diagnosis if you upload a sample workbook.

    I will add that the code works fine in an empty worksheet. Hence the need to see your workbook/worksheet/data.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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: 3
    Last Post: 07-01-2020, 10:15 AM
  2. Rows appear to be hiding and un-hiding themselves
    By chrisellis250 in forum Excel General
    Replies: 2
    Last Post: 08-18-2016, 07:37 AM
  3. Hiding a button when hiding rows
    By fergusor in forum Excel General
    Replies: 2
    Last Post: 08-10-2006, 09:31 AM
  4. Replies: 4
    Last Post: 08-09-2006, 02:19 PM
  5. Replies: 2
    Last Post: 10-18-2005, 10:05 PM
  6. Replies: 5
    Last Post: 01-19-2005, 05:26 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