+ Reply to Thread
Results 1 to 5 of 5

Conditional Formatting and Row Height

Hybrid View

  1. #1
    Registered User
    Join Date
    12-18-2008
    Location
    Sydney, Australia
    Posts
    94

    Conditional Formatting and Row Height

    First up - I am trying to get conditional formatting to work in the sheet named "Main" in the attached document. What I need is for the cell to change a specific colour if a certain total is displayed in another cell (Red if the total is between 0-25, Amber if between 26-55, etc). I have set up Lists and named the ranges (these can be found in the sheet named "Action List) and then gone into Conditional Formating and set it up - but its not working.

    Secondly - I have tried to format the rows to automatically change height when text is entered - and it only seems to be working for text relating to column B !!!! I have standard responses that need to go into column H - which then should automatically adjust the row height to fit the response !!! I have tried all avenues that I know - is there something I am missing? I have also made notes in the sheet names "Audit Protocol".

    Relevant document has been attached with descriptors !!!!!

    Any help will be muchly appreciated
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Conditional Formatting and Row Height

    Auto row height, I don't believe I've EVER been able to get a text string brought over through a formula to adjust the cell height, only text typed directly into the cell has ever done that for me. Maybe someone else has better news on that issue.

    On the MAIN sheet, for cell J14, open the conditional formatting and change it to:
    =I14<26

    K14 is:
    =AND(I14<56,I14>25)

    L14 is:
    =AND(I14<95,I14>55)

    M14 is:
    =I14>94

    NOTE:
    You could make cell I14 light up the same way to match by putting the last three conditions into the cell conditional formatting for that cell, start at the large number and work down, and then default the background color to red.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    12-18-2008
    Location
    Sydney, Australia
    Posts
    94

    Re: Conditional Formatting and Row Height

    Thanks for the response - it all worked beautifully !!!! I think I was just complicating the matter (i have been working in this spreadsheet for too long !!!) ..... You rock !!!!

    Hopefully the issue of auto row height will be solved !!!!!

    Cheers ....

  4. #4
    Chris Bode
    Guest

    Re: Conditional Formatting and Row Height

    Please follow following steps
    1.Right click toolbar>click control box
    2. From the control box select command button and draw tit to your sheet
    3.Doble click on the command button and paste following codes in the code window
    Private Sub CommandButton1_Click()
    Dim row As Integer, col As Integer
    row = 1
    col = 1

    Dim rowinsheet2 As Integer, colinsheet2 As Integer
    rowinsheet2 = 1
    colinsheet2 = 2

    While Sheet1.Cells(row, col).Value <> ""
    If chksheet2(Sheet1.Cells(row, col).Value) = True Then
    Sheet2.Cells(rowinsheet2, colinsheet2).Value = Sheet1.Cells(row, col + 1)
    Sheet2.Cells(rowinsheet2, colinsheet2 + 1).Value = Sheet1.Cells(row, col + 2)

    rowinsheet2 = rowinsheet2 + 1
    End If
    row = row + 1
    Wend
    End Sub

    Private Function chksheet2(str As String) As Boolean
    Dim tmp As Boolean
    tmp = False

    Dim row As Integer, col As Integer
    row = 1
    col = 1

    While Sheet2.Cells(row, col).Value <> ""
    If str = Sheet2.Cells(row, col).Value Then
    tmp = True
    End If

    row = row + 1
    Wend

    chksheet2 = tmp
    End Function

    Hope this works for you

    Have a nice time……
    Last edited by mudraker; 02-28-2009 at 07:27 AM.

  5. #5
    Registered User
    Join Date
    12-18-2008
    Location
    Sydney, Australia
    Posts
    94

    Re: Conditional Formatting and Row Height

    Thanks for your help ... I tried this - and it doesnt work !!!! I inserted a command box and copied the code as is - but when i click the button - it doesnt do anything !!!!

    Your help is muchly appreciated though !!!!! cheers A

+ 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