+ Reply to Thread
Results 1 to 4 of 4

Determine minimum indent level of selected cells

  1. #1
    Registered User
    Join Date
    01-20-2009
    Location
    Austin, TX
    MS-Off Ver
    Excel 2007
    Posts
    8

    Determine minimum indent level of selected cells

    I need to determine if any of the cells selected by the user have an indent level equal to 1 and if so then have them confirm the action. the below works well if the user only selects one cell but if the select 2 or more and any of the selected cells has an indent level greater than 1 it doesn't show the confirmation.



    Please Login or Register  to view this content.
    Last edited by gnethery; 12-29-2009 at 11:24 AM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Determine minimum indent level of selected cells

    What am I missing? It looks like the code does the same thing whether the user chooses Yes or No.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    01-20-2009
    Location
    Austin, TX
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Determine minimum indent level of selected cells

    You are correct. Ultimatly the indent of the selected cells is decreased. What I want happen is this example

    User select 3 cells in column:
    Cell 1 - Indent level = 1
    Cell 2 - Indent level = 2
    Cell 3 - Indent level = 2

    If the user only selected Cell 1, then all works as expected. E.g. - confirmation message is displayed and when user confirms the indent level is decreased. But when the user selects cells 1 & 2 is doesn't work as expected.

    Here is what I want:
    If any one of the selected cells indent level is = 1 then display the confirmation message and if user answers yes then decrease the indent. The decrease indent works but since some of the selected cells has an indent level <> 1 then the confirmation message does not appear.
    Last edited by gnethery; 12-28-2009 at 09:54 PM.

  4. #4
    Registered User
    Join Date
    01-20-2009
    Location
    Austin, TX
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Determine minimum indent level of selected cells

    OK...I have it working using a For Each statement but not sure this is the best way

    Please Login or Register  to view this content.

    If a user select 5 cells 2 have an indent level of 1 and 3 have an indent level of 2 then the confirmation message is shown once and then the indent is decreased.

+ 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