Macro - Pasting cell contents into FIND Function

AYouQueTai

Board Regular
Joined
Sep 14, 2019
Messages
50
Office Version
  1. 365
Platform
  1. Windows
Hi there,

Here is my dilemma, everyday I check the last entry in a column and cross reference it with data from another workbook to see if I need to add data to my original sheet.
So when i recorded my macro, I thought i'd be able to copy the contents of my last entry and paste it into the find and replace window. (to find in the cross reference)
The problem is it's using the data from when i recorded the macro instead of pasting the fresh data from the clipboard. I've highlighted it in red. I want my clipboard contents to be pasted in the red section. Is there a way to do that? Thanks

Selection.End(xlDown).Select
Selection.Copy
Windows("blabla.xlsx").Activate
Cells.Find(What:="303296", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
How about
Code:
Dim Rng As Range
Set Rng = Selection.End(xlDown)

Windows("blabla.xlsx").Activate
Cells.Find(What:=Rng.Value, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,250
Members
452,623
Latest member
Techenthusiast

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