Hi,
i have a multiple people using a copy of the same workbook. copy 1, copy 2, etc.
the issue i am having is i need to remove myself or anyone in this list that is using the sheet from the CC
on my PC it works, on the other employees it does not work.
can someone tell me what i'm doing wrong here?
let me know if you need additional information, thank you in advance!
i have a multiple people using a copy of the same workbook. copy 1, copy 2, etc.
the issue i am having is i need to remove myself or anyone in this list that is using the sheet from the CC
First Name | Last Name | Emails |
Alex | I | AI@something.net |
Chris | R | CR@something.net |
Luz | E | LE@something.net |
Kate | G | KG@something.net |
ALEX | P | AP@something.net |
VBA Code:
Set whoswho = Worksheets("Customer Service Reps").Range("whoswho") ' whoswho is located at ='Customer Service Reps'!$G$2:$I$6,'Customer Service Reps'!$L$2:$L$6
With whoswho
For i = 2 To .Rows.Count
If Not Environ("UserName") = Sheets("Customer Service Reps").Cells(i, 12) Then
usernames = usernames & ", " & Sheets("Customer Service Reps").Cells(i, 12)
sTo = sTo & "; " & Sheets("Customer Service Reps").Cells(i, 9)
End If
Next
End With
VBA Code:
With WS
.Range("D2:D" & LR).Select
For Each r In Selection
For i = 2 To LR3
CSR1 = Range("K" & r.Row)
S1 = Range("L" & r.Row)
S2 = Range("F1").Value & ":" & Range("F" & r.Row)
S3 = Range("G1").Value & ":" & Range("G" & r.Row)
B1 = Range("C1").Value & ":" & Range("C" & r.Row)
If S1 = "SPLIT ORDER" Then
B2 = "<b>Stock Out:</b>" & "<p>Line: " & _
" ESD:   Part #:" & _
"<p>" & "<b>ORDER GOOD:</b>" & "</p>"
ElseIf S1 = "STOCK OUT" Then
B2 = "<b>Stock Out:</b>" & "<p>Line: " & _
" ESD:   Part #:" & _
"<p>"
ElseIf S1 = "BACKORDER TO RELEASE" Then
B2 = "<b>BACKORDER TO RELEASE</b>" & "<p>" & _
"</p>"
Else: B2 = ""
End If
Next
Dim mApp As Outlook.Application
Set mApp = New Outlook.Application
Dim mMail As Outlook.MailItem
Set mMail = mApp.Createitem(mMailItem)
Set mApp = CreateObject("Outlook.Application")
Set mMail = mApp.Createitem(0)
On Error Resume Next
With mMail
.display
End With
With mMail
.To = LCase(CSR1)
.CC = LCase(sTo) & "; " & "cs@something.net"
.Subject = S1 & " " & S2 & " " & S3
.HTMLBody = vbclf & B2 & WMBody & vbclf
End If
End With 'mMail
Next r 'mail's to and cc
End With ' worksheet
Set OutMail = Nothing
Set OutApp = Nothing
on my PC it works, on the other employees it does not work.
can someone tell me what i'm doing wrong here?
let me know if you need additional information, thank you in advance!