+ Reply to Thread
Results 1 to 4 of 4

Multiple Function issue

Hybrid View

sryan32 Multiple Function issue 03-09-2010, 03:40 PM
JBeaucaire Re: Multiple Function issue 03-09-2010, 03:48 PM
sryan32 Re: Multiple Function issue 03-09-2010, 04:45 PM
JBeaucaire Re: Multiple Function issue 03-09-2010, 08:24 PM
  1. #1
    Registered User
    Join Date
    03-09-2010
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Multiple Function issue

    I am fairly new to VBA and am having an issue that I cannot figure out. The first section of my code provides conditional formatting based on the items in the third columns drop down menu. This section of code is working fine. The second section of code is meant to take a row that has "completed" in the 3rd column, and copy the entire row and paste it to the second sheet "Completed". I have this code working in a seperate file, but when I try to combine the two functions I can't get it to work. Any thoughts? Thanks in advance for any help.
    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: Multiple Function issue

    Try this, remove all the other code and replace with:
    Option Compare Text 'A=a, B=b, ... Z=z
    Option Explicit
     
    Sub Worksheet_Change(ByVal Target As Range)
    Dim Cell As Range
    Application.EnableEvents = False
    On Error GoTo ErrorExit
        
        For Each Cell In Target
            Select Case Cell.Value
                Case vbNullString
                    Cell.Interior.ColorIndex = xlNone
                    Cell.Font.Bold = False
                Case "URGENT"
                    Cell.Interior.ColorIndex = 3
                    Cell.Font.Bold = True
                Case "Incoming"
                    Cell.Interior.ColorIndex = 17
                    Cell.Font.Bold = False
                Case "To Do"
                    Cell.Interior.ColorIndex = 6
                    Cell.Font.Bold = True
                Case "Outgoing"
                    Cell.Interior.ColorIndex = 46
                    Cell.Font.Bold = False
                Case "Completed"
                    Cell.EntireRow.Copy
                    Worksheets("Completed").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteValuesAndNumberFormats
                    Cell.EntireRow.Delete
                Case Else
                    Cell.Interior.ColorIndex = xlNone
                    Cell.Font.Bold = False
            End Select
        Next
        
    ErrorExit:
    Application.EnableEvents = True
    End Sub
    _________________
    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
    03-09-2010
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Multiple Function issue

    Yes works perfectly. Thanks for your help.

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

    Re: Multiple Function issue

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.


    ====
    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated. It is found across from the "time" in each of our posts.)

+ 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