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>
 

Some videos you may like

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Watch MrExcel Video

Forum statistics

Threads
1,109,359
Messages
5,528,225
Members
409,809
Latest member
VICKRAM

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top