Hi,
I've ben pulling my hair out trying to figure out this simple code. It's supposed to copy values and formatting only from selected rows from a table in one worksheet to another worksheet, removing blanks and duplicates . I've tried multiple ways, which either work and then stop working, or not work at all (notably, the range(.sheets.rows.count).end(xlup) method stops at the end of the table, before it gets to the last line of code).
The current code below only copies the first 5 or 6 rows of data, and I can't figure out why.
Please help!
Option Explicit
Sub CopyPasteMeds()
Worksheets("Reconcile Meds Here").Range("C6", Worksheets("Reconcile Meds Here").Range("L6").End(xlDown)).ClearContents
Worksheets("paste meds here").Range("m6", "t40").Copy
Worksheets("Reconcile Meds Here").Range("C6").PasteSpecial , Paste:=xlPasteValuesAndNumberFormats, skipblanks:=True
Worksheets("Reconcile Meds Here").Range("C6", "L40").RemoveDuplicates Columns:=3, Header:=xlNo
Worksheets("Reconcile Meds Here").Activate
End Sub
I've ben pulling my hair out trying to figure out this simple code. It's supposed to copy values and formatting only from selected rows from a table in one worksheet to another worksheet, removing blanks and duplicates . I've tried multiple ways, which either work and then stop working, or not work at all (notably, the range(.sheets.rows.count).end(xlup) method stops at the end of the table, before it gets to the last line of code).
The current code below only copies the first 5 or 6 rows of data, and I can't figure out why.
Please help!
Option Explicit
Sub CopyPasteMeds()
Worksheets("Reconcile Meds Here").Range("C6", Worksheets("Reconcile Meds Here").Range("L6").End(xlDown)).ClearContents
Worksheets("paste meds here").Range("m6", "t40").Copy
Worksheets("Reconcile Meds Here").Range("C6").PasteSpecial , Paste:=xlPasteValuesAndNumberFormats, skipblanks:=True
Worksheets("Reconcile Meds Here").Range("C6", "L40").RemoveDuplicates Columns:=3, Header:=xlNo
Worksheets("Reconcile Meds Here").Activate
End Sub