VAB Find text in Col and copy the last cell in the row

liwi2

New Member
Joined
Apr 14, 2014
Messages
26
Hi All,
I hope you will be able to help me. I tried to look online for solution but no luck so far.

What I am trying to do is to search for text ie "Apple" in col A.
Once found I want to set the last used cell as source to replicate the value in destination.
I have the search bit which works but can't figure out how to get the last cell from range cel row.

Dim SrchRng As Range, cel As Range
Set SrchRng = WorkBk.Worksheets(1).Range("A1:A100")
For Each cel In SrchRng
If InStr(1, cel.Value, "Apple") > 0 Then

Thanks in advance for your help
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
easiest way would be to start at the far right of the row and jump back, like ctrl + arrow. You already know the row because you've found cel, so you can refer to the last used cell in the row using
Code:
WorkBk.Worksheets(1).Cells(cel.row,16384).End(xlToLeft)
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,967
Members
452,371
Latest member
Frana

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