Find and copy the last cell with function to another sheet in excel using macro.

gkzeta

New Member
Joined
Mar 15, 2019
Messages
10
I'm trying to do the following:
I have 3 worksheets A, B and C.
In worksheet A, I have dates, names and corresponding values,
in the sheet B I have names and the total that each one has, i.e. the following act e.g. = b2 from sheet A gets the data, and in sheet C I want for a name to display the corresponding last entry from sheet B.
I do the code in visual basic and it shows me the date but does not show the Total, which is equal to a cell from another task sheet. If I replace my cell with number it shows the last number but I want to display the last cell which is equal to = b2 from another sheet.
The code, which I use, is:
sheetA.Range("a" & Rows.Count).End(xlUp).Copy
sheetC.Cells(3, 1).PasteSpecial xlPasteAll
Range("c" & Rows.Count).End(xlUp).Select
sheetA.Range("c" & Rows.Count).End(xlUp).Copy
sheetC.Cells(3, 3).PasteSpecial xlPasteAll

<tbody>
</tbody>

<tbody>
</tbody>
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,214,405
Messages
6,119,320
Members
448,887
Latest member
AirOliver

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