+ Reply to Thread
Results 1 to 14 of 14

Conflicting formatting results

Hybrid View

  1. #1
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,291

    Re: Conflicting formatting results

    Hey jacob,

    A real mystery is one you never figure out. Now - how do you make one line of code finish before the next one runs?

    Try putting a mandatory .Calculate in between your two lines of code. DoEvents (I believe) waits for other windows applications to pause before continuing. I always follow any SendKeys statements in my code with DoEvents to make sure that they were sucked out of the keyboard buffer, before proceeding. Maybe telling Excel it needs to recalculate the entire workbook would be the pause you need.
    See http://www.decisionmodels.com/calcsecretsh.htm or http://msdn.microsoft.com/en-us/libr...ffice.11).aspx

    BTW - do you have a Application.ScreenUpdate = False in your code? This might be keeping the AutoFit from knowing how wide things are.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  2. #2
    Forum Contributor
    Join Date
    10-16-2010
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2003, 2010
    Posts
    151

    Re: Conflicting formatting results

    I tried the DoEvents between the two lines with no luck, I'll try the .calculate to see if that helps. I never did an Application.ScreenUpdate line in the code, so I am watching it do its thing. I generally leave that til last so that I can see that everything is proceeding as expected, (plus it reminds me of the magic drawing board of Captain Kangaroo watching all the screen updates).

    Thanks for all of your help and suggestions. I will continue to play with it to see if I can get it to work properly.
    Jacob Albers
    Excel 2003 & 2010

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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