Use clipboard as reference, but clipboard is empty?

Ajweis01

New Member
Joined
Jul 28, 2015
Messages
3
I have this code below. Whenever I send an email, I want to put a "Y" in the corresponding row with a unique code that I entered. As I go through this code, I get to the line If item_in_review = Sheets("Data").Range("K" & row_number), but it keeps saying the clipboard is empty, but the excel sheet shows that it has been copied. How can I change this?

Code:
Private Sub SendMail_Click()
row_number = 0
Dim olApp As Outlook.Application
Dim olMail As Outlook.MailItem
 
Set olApp = New Outlook.Application
For i = 5 To Sheet7.Cells(Rows.Count, 4).End(xlUp).Row
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = Cells(i, 6).Value
.Subject = "You Have a Delivery"
.Body = "Hello " & Cells(i, 3) & vbNewLine & vbNewLine & "There is " & Cells(i, 4).Value & " for you in the plan room from " & Cells(i, 5).Value & "."
.Display


End With
Next
Set olMail = Nothing
Set olApp = Nothing
For i = 5 To Sheet7.Cells(Rows.Count, 4).End(xlUp).Row
Cells(i, 7).Copy
Do
DoEvents
row_number = row_number + 1
item_in_review = Sheets("Data").Range("K" & row_number)
If item_in_review = Clipboard Then
Sheets("Data").Range("Q" & row_number) = "Y"
End If
Loop Until item_in_review = ""
Next

End Sub
 
Last edited:

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,216,583
Messages
6,131,557
Members
449,655
Latest member
Anil K Sonawane

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top