+ Reply to Thread
Results 1 to 9 of 9

Having issue the unselecting a cell

  1. #1
    Forum Contributor
    Join Date
    05-13-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    378

    Question Having issue the unselecting a cell

    Good Friday All!!!

    So I have the following code...

    Please Login or Register  to view this content.
    This code currently changes the format of the dates with in the spreadsheet and then searches 2 columns for blanks. In 2 columns, I want the row to highlight if the cell is blank. I have that part working. However, if there are no blanks in those 2 columns, then it seems to highlight the last cell in the last formatted date column. How do I fix this?

    I have attached a sample worksheet I am using so you can see what happens. Sheet 1 has a blank in the Repair Activity 1 Column and sheet 2 does not contain any blanks.


    I look forward to your solutions!!!

    Thanks!!!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    07-17-2012
    Location
    Manama,Bahrain
    MS-Off Ver
    2003, 2007
    Posts
    71

    Re: Having issue the unselecting a cell

    Hi,

    If you are having a problem with this part of the execution....

    Please Login or Register  to view this content.
    You have to just c.entirerow.select action to the next row and provide and "End IF" after the "End With" statement. I have not check your sheet however it seems that the with statement is executed during the loop or near the end of the loop notwithstanding the result of the IF...THEN check.
    Last edited by Cutter; 07-20-2012 at 09:22 PM. Reason: Added code tags

  3. #3
    Forum Contributor
    Join Date
    05-13-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    378

    Re: Having issue the unselecting a cell

    I have entered the "End If" after the "End With" but then I get a compile error that says, "End If without Block If."

  4. #4
    Registered User
    Join Date
    07-17-2012
    Location
    Manama,Bahrain
    MS-Off Ver
    2003, 2007
    Posts
    71

    Re: Having issue the unselecting a cell

    Hi Dwhite30518,

    You also have to move the c.entirerow.select as well down in the preceding If...then statement in both instances.

    that section of code should look like

    Please Login or Register  to view this content.
    see if it works.

  5. #5
    Forum Contributor
    Join Date
    05-13-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    378

    Re: Having issue the unselecting a cell

    When I use that code a get an error that says, "Next without For."

  6. #6
    Registered User
    Join Date
    07-17-2012
    Location
    Manama,Bahrain
    MS-Off Ver
    2003, 2007
    Posts
    71

    Re: Having issue the unselecting a cell

    Hi dwhite30518,

    Can you please paste the code that you've just tried to execute.

  7. #7
    Forum Contributor
    Join Date
    05-13-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    378

    Re: Having issue the unselecting a cell

    Please Login or Register  to view this content.
    This is the entire code that I have been working with and you can use on the workbook I posted and see the results I have been getting.

    Thanks!!!

  8. #8
    Registered User
    Join Date
    07-17-2012
    Location
    Manama,Bahrain
    MS-Off Ver
    2003, 2007
    Posts
    71

    Re: Having issue the unselecting a cell

    Hi Dwhite30518,

    This is the corrected code. Execute this

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    05-13-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    378

    Re: Having issue the unselecting a cell

    Awesome!!! That works great...Thanks!!!!!!!!!!

+ 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