Pasting data in cell adjacent to specific word

mozza90

New Member
Joined
Mar 19, 2015
Messages
32
Hi,

I a spreadsheet ("Sales") that tracks a total sales figure and each day is a new column. e.g. the below table.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[TD]03/06/2018[/TD]
[TD]04/06/2018[/TD]
[TD]05/06/2018[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Sales[/TD]
[TD]50,000[/TD]
[TD]60,000[/TD]
[TD]65,000[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Costs[/TD]
[TD]10,000[/TD]
[TD]32,000[/TD]
[TD]4,000[/TD]
[/TR]
[TR]
[TD]...[/TD]
[TD].....[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]...[/TD]
[TD]....[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]...[/TD]
[TD]...[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]106[/TD]
[TD]Salesperson1[/TD]
[TD]24,000[/TD]
[TD]29,000[/TD]
[TD]36,000[/TD]
[/TR]
[TR]
[TD]107[/TD]
[TD]Salesperson2[/TD]
[TD]18,000[/TD]
[TD]18,500[/TD]
[TD]28,000[/TD]
[/TR]
</tbody>[/TABLE]


I need to find the last values in rows 106 and 107 and copy them into a workbook called "Daily Tracker 2018.xlsx" which is already open. The figures will be copied into the cell adjacent to the words Salesperson1 and Salesperson2. These words are always in column A, so the data will always be pasted into Column B but the row may vary over time.

So far I have the below, but I can't seem to find a way to search for the word Salesperson1 and paste the data into the adjacent cell. Any ideas on how to do this?

Code:
Dim Sales As Workbook
Dim Tracker As Workbook

Set Sales = Workbooks("Sales")
Set Tracker = Workbooks("Daily Tracker 2018")

Sales.Activate
Range("XFD106").Select
Selection.End(xlToLeft).Select
Selection.Copy

Tracker.Activate
 
Last edited:

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
How about
Code:
   Dim Fnd As Range
   
   Set Fnd = Range("A:A").Find("Salesperson1", , , xlWhole, , , False, , False)
   If Not Fnd Is Nothing Then Fnd.Offset(, 1).PasteSpecial
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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