+ Reply to Thread
Results 1 to 5 of 5

"Compile error: End With without With" but, I have two "With"s and two "End With"s

  1. #1
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    "Compile error: End With without With" but, I have two "With"s and two "End With"s

    Here is the VBA code.:
    Please Login or Register  to view this content.
    Could someone please tell me what I am doing wrong with this macro?

    Any input would be appreciated!

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: "Compile error: End With without With" but, I have two "With"s and two "End With"s

    Hi, s3a,

    might be the missing end If which is causing the error:
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: "Compile error: End With without With" but, I have two "With"s and two "End With"s

    Actually the problem was in fact an "End If" but not where you placed it. I figured it out since you mentioned it, though. Thanks!

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: "Compile error: End With without With" but, I have two "With"s and two "End With"s

    Hi, s3a,

    sorry for the wrong placing - it was just my guess. Fine if you could get the problem solved.

    Ciao,
    Holger

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: "Compile error: End With without With" but, I have two "With"s and two "End With"s

    If you do not already have it, Smart Indenter can help significantly in preventing these types of oversights.
    HTH
    Regards, Jeff

+ 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