Results 1 to 6 of 6

VBA Excel Macro - change colour of text

Threaded View

  1. #1
    Registered User
    Join Date
    05-27-2014
    Posts
    4

    VBA Excel Macro - change colour of text

    I need to change the colour of: 'Cells(cell.Row, "A").Value' Cells(cell.Row, "E").Value to blue.
    Can you help?

    Many thanks ,


    Sub Test1()
        
        Dim OutApp As Object
        Dim OutMail As Object
        Dim cell As Range
        Dim Test As String
        
    
    
        Application.ScreenUpdating = False
        Set OutApp = CreateObject("Outlook.Application")
    
        On Error GoTo cleanup
        For Each cell In Columns("B").Cells.SpecialCells(xlCellTypeConstants)
            If cell.Value Like "?*@?*.?*" And _
               LCase(Cells(cell.Row, "C").Value) = "yes" Then
    
                Set OutMail = OutApp.CreateItem(0)
                On Error Resume Next
                 
                 With OutMail
                    .To = cell.Value
                    .Subject = "TITLE" & " - " & Format(Now, "dd_mmmm_yyyy")
    
                    .Body = Test & "Dear " & Cells(cell.Row, "A").Value _
                          & vbNewLine & vbNewLine & _
                            "Text1" & _
                            vbNewLine & vbNewLine & _
                            "Text2'" & Cells(cell.Row, "E").Value & "TEXT" & _
                            vbNewLine & vbNewLine & _
                            "TEXT3" & _
                            vbNewLine & vbNewLine & _
                            "TEXT4" & _
                            vbNewLine & vbNewLine & _
                            "TEXT5" & _
                            vbNewLine & vbNewLine & "Many thanks," & vbNewLine & vbNewLine & "DCX PMO Team"
                               
                    'Adding an attachment
                    .Attachments.Add ("D:\Users\ABOHANNO\Desktop\Digital Transformation\tagging\DCX Sales Process.pptx")
                    .Send  'Or use Display
                    
                    
                    
                End With
                On Error GoTo 0
                Set OutMail = Nothing
            End If
        Next cell
    
    cleanup:
        Set OutApp = Nothing
        Application.ScreenUpdating = True
    End Sub
    Last edited by alansidman; 05-27-2014 at 01:19 PM. Reason: code tags added

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Macro to change text colour of adjacent cell to the same text colour as target cell
    By kayoke in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-28-2012, 04:18 AM
  2. Replies: 2
    Last Post: 06-07-2011, 07:00 AM
  3. Macro to change colour and and text in shape and then back again
    By jamer02 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-16-2010, 07:17 AM
  4. Macro to Change the colour of cell based on text
    By rakeshplb in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-26-2009, 04:17 AM
  5. Replies: 3
    Last Post: 03-08-2006, 11:01 AM

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