+ Reply to Thread
Results 1 to 7 of 7

Weird VBA behavior.

  1. #1
    Registered User
    Join Date
    02-26-2020
    Location
    Texas
    MS-Off Ver
    365
    Posts
    37

    Weird VBA behavior.

    Okay, this will be strange.
    I have a couple of tabs in an excel workbook that all have merged cells and I am using VBA to auto-fit and hide rows.
    On one of the tabs, the VBA works.
    But on the other tab, the very first cell fails to auto-fit, but the second cell works properly.

    Code for first tab (this one, "b4" fails, but "b8" works:
    Please Login or Register  to view this content.
    On this tab, the code is essentially the same.
    All of it works properly.
    Please Login or Register  to view this content.
    You'll note, the section that is auto-fitting is EXACTLY the same.
    The tabs have the same formatting, same column width, same same same.
    I can even copy / paste the VBA from the working tab, to the one that doesn't work, and it will fail again.
    Am I going nuts here? Is there something obvious that I am missing?

    I actually have a third tab with very similar code with different cells referenced. It too works properly.
    The workbook is much to large to upload and contains sensative data.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,329

    Re: Weird VBA behavior.

    What is actually in B4 on the tabs?
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    02-26-2020
    Location
    Texas
    MS-Off Ver
    365
    Posts
    37

    Re: Weird VBA behavior.

    Yes sir, the top part is exactly the same.
    It should produce something similar to this:

    Attachment 858009

    However, the rows need to expand as the information in those boxes increase.
    Work fine on all of my tabs except this one. Was even thinking of deleting the tab and starting over if I can't figure this out.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,329

    Re: Weird VBA behavior.

    That attachment doesn't work for me. You need to attach pictures the same way you attach workbooks.

    But "yes" isn't really an answer to "what?"...

  5. #5
    Registered User
    Join Date
    02-26-2020
    Location
    Texas
    MS-Off Ver
    365
    Posts
    37

    Re: Weird VBA behavior.

    Oh forgive me.
    The cell contains a reference to another tab (on all, they are the same)

    =UPPER('Depo Order'!D7)
    Attached Images Attached Images

  6. #6
    Registered User
    Join Date
    02-26-2020
    Location
    Texas
    MS-Off Ver
    365
    Posts
    37

    Re: Weird VBA behavior.

    In this case, (and there is a header not shown on the image) it would be the first party to the suit (or cause - if I'm being formal).
    a.k.a. - the plaintiff.

  7. #7
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,329

    Re: Weird VBA behavior.

    Have you tried copying and pasting that cell from a tab that works to the one that doesn't just to remove any formatting differences?

+ 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. [SOLVED] Weird Excel behavior
    By MB421 in forum Excel General
    Replies: 5
    Last Post: 05-26-2013, 10:29 PM
  2. Weird formula behavior
    By idiotmitten in forum Excel General
    Replies: 1
    Last Post: 12-23-2010, 10:47 AM
  3. Weird sort behavior
    By mfactor in forum Excel General
    Replies: 4
    Last Post: 11-21-2009, 01:12 PM
  4. OptionButton weird behavior
    By dpenny in forum Excel General
    Replies: 2
    Last Post: 04-16-2007, 08:06 PM
  5. [SOLVED] Excel weird behavior
    By [email protected] in forum Excel General
    Replies: 4
    Last Post: 05-25-2006, 03:30 PM
  6. [SOLVED] Weird clipboard behavior
    By Josh Sale in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-06-2005, 06:05 PM
  7. [SOLVED] Weird Sorting Behavior
    By Jim Thomlinson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-04-2005, 12:06 AM
  8. Weird behavior of VLOOKUP
    By John Simons in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-29-2005, 10:07 PM

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