Thanks Fluff13!
Posts by ChobaniDevourer
-
-
I have this simple code that needs to change a string color so that half is red and half is blue. When i break the string up it shows the color fine but when i put them back together the color reverts to black. Is there a simple way of keeping the color on the halves?
Code- Sub ColorChange()
- Dim Text1 As String
- Dim Text2 As String
- Dim Text3 As String
- Text1 = Left(Sheet1.Range("A1").Value, 25)
- Text2 = Right(Sheet1.Range("A1").Value, 13)
- Text3 = Sheet1.Range("B1").Value & " " & Sheet1.Range("C1").Value
- Sheet1.Range("B1").Value = Text1
- Sheet1.Range("B1").Font.Color = vbBlue
- Sheet1.Range("C1").Value = Text2
- Sheet1.Range("C1").Font.Color = vbRed
- Sheet1.Range("D1").Value = Text3
- End Sub
-
Thanks for trying that Carim, its still not running through all of them. I get why you changed the m value because it was going to be static for the whole thing. I'm going to keep looking at it!, ill update if i figure it out!
-
But if it always ends in CBend0.bmp thats where the 10 comes from. No problem tho, lets wait for a more experienced person:D
-
This is coming from another beginner so take with grain of salt.
Code- Sub Stringtrim()
- Dim Text1 As String
- Dim Text2 As String
- Dim Text3 As String
- Text1 = Range("a1").Value ' input the cell value of the cell you want to trim in place of a1
- Text2 = Right(Text1, 10)
- Text3 = Left(Text2, 6)
- Worksheets(1).Range("B1").Value = Text3 'same with this, change b1 to the cell you want it to output trimmed value to
- End Sub
-
Code
- Sub Download_attachments()
- Dim olapp As Outlook.Application
- Dim olmail As MailItem
- Dim Att As Object
- Dim olfolder As Outlook.Folder
- Dim namap As NameSpace
- strfolderpath = "O:\sgSales\Shared\sgPOD\Documents\CreditNDFax\"
- Set olapp = CreateObject("Outlook.Application")
- Set olmail = olapp.CreateItem(olMailItem)
- Set olfolder = olapp.GetNamespace("MAPI").PickFolder
- For Each olmail In olfolder.Items.Restrict("[Unread]=true")
- olmail.UnRead = False
- If TypeName(olmail) = "MailItem" Then
- m = 1
- For Each Att In olmail.Attachments
- strfile = olmail.Attachments.Item(m).FileName
- strfile = strfolderpath & strfile
- olmail.Attachments.Item(m).SaveAsFile strfile
- Next Att
- Else
- Exit Sub
- End If
- Next
- End Sub
This code is meant to download attachments to Outlook messages that are unread , then to mark them as read ( they are faxed to me and i process them in outlook currently, hoping to have them be more easily accessible in the folder creditNDfax and eventually see about using an OCR to rename them but for now this is a big step). It handles the task but it then only does a few messages at a time and requires me to re-run the macro until all the attachments have been cleared and marked read.
Any help on this would be huge.