Results 1 to 7 of 7

Multiple condition formatting

Threaded View

  1. #3
    Registered User
    Join Date
    05-08-2009
    Location
    Yogya
    MS-Off Ver
    Excel 2007
    Posts
    96

    Re: Multiple condition formatting

    Thanks!
    Just one more thing :

    How do we state that if the condition is not met,
    the specific cell remain unchanged?

    .
    .
    .
    Case else : cell remains unchanged
    e.g if there is 67 in column A1, then the cell remains as 67 because 67 is not in the case-select conditions


    Column A1
    
    3
    4
    5
    7
    8
    9
    67
    Sub Change()
    Dim Beta As Range, cell As Range
    
    Set Beta = Range("A1:A7")
        
        For Each cell In Beta
            Select Case cell.Value
                Case 3:    cell = "'0006"
                Case 4:    cell = "'0043"
                Case 5:    cell = "'0002"
                Case 7:    cell = "'0001"
                Case 8:    cell = "'0011"
                Case 9:    cell = "'0003"
            End Select
        Next cell
        
    End Sub
    result

    6
    43
    2
    1
    11
    3
    67
    Last edited by Kb24; 09-10-2009 at 07:33 AM.

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