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

gkzeta

New Member
Joined
Mar 15, 2019
Messages
10
[TABLE="width: 99%"]
<tbody>[TR]
[TD][TABLE="width: 100%"]
<tbody>[TR]
[TD]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[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

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