Hey,
I would like to ask you if you could help me out with the following macro. I want to copy excel rows based on a certain value in a column and paste them in a outlook mail. After having done that I want to change the cells value in the unique rows to sth else - for example - "check" being in a green colour. This is the code I produced so far. But it doesnt display the rows..it just opens the mailbox in outlook..Pls help. Thank you
Sub cond_copy()
Sheets("Sheet1").Select
RowCount = Cells(Cells.Rows.Count, "a").End(xlUp).Row
For i = 1 To RowCount
'assuming the true statment is in column a
Range("a" & i).Select
check_value = ActiveCell
If check_value = "True" Or check_value = "true" Then
ActiveCell.EntireRow.Copy
End with
Set oApp = CreateObject("Outlook.Application")
Set oMail = oApp.CreateItem(0)
With oMail
'Uncomment the line below to hard code a recipient
.To = "someone@somedomain.com"
'Uncomment the line below to hard code a subject
'.Subject = paste
.display
End with
End If
Next
End Sub
I would like to ask you if you could help me out with the following macro. I want to copy excel rows based on a certain value in a column and paste them in a outlook mail. After having done that I want to change the cells value in the unique rows to sth else - for example - "check" being in a green colour. This is the code I produced so far. But it doesnt display the rows..it just opens the mailbox in outlook..Pls help. Thank you
Sub cond_copy()
Sheets("Sheet1").Select
RowCount = Cells(Cells.Rows.Count, "a").End(xlUp).Row
For i = 1 To RowCount
'assuming the true statment is in column a
Range("a" & i).Select
check_value = ActiveCell
If check_value = "True" Or check_value = "true" Then
ActiveCell.EntireRow.Copy
End with
Set oApp = CreateObject("Outlook.Application")
Set oMail = oApp.CreateItem(0)
With oMail
'Uncomment the line below to hard code a recipient
.To = "someone@somedomain.com"
'Uncomment the line below to hard code a subject
'.Subject = paste
.display
End with
End If
Next
End Sub