Hello,
First post here on this site. If I have made any etiquette mistakes, please let me know.
I have a workbook with two sheets.
Sheet 1 has data entries in order of their entry.
Sheet 2 is a Table of the same data entries sorted by Author Last Name, Author First Name, Publication Year, Publication Month, Publication Day and Book Type.
The goal is to HIDE duplicate entries of Author Last Name and Author First Name in the Table on Sheet 2.
The following code works until it encounters an author with the same last name, but a different first name from another author. It hides the Author’s Last Name even when the Author First Name is different.
I would like to use VBA to perform this procedure. Also first time writing code, so suggestions on how to amend this code as opposed to another method would be appreciated.
Here is a condensed version of what I am trying to accomplish.
Col A Col B Col C Col D
1 ID AUTHOR AUTHOR TITLE
LAST NAME FIRST NAME
2 953 Albom Mitch One More Day
3 653 Five People You Meet In Heaven, The
4 17 Right
5 1200 Alexander Victoria What Happens At Christmas
6 15 Baldacci Anne All Dogs
7 16 Good Dogs
8 1196 Baldacci David Forgotten, The
9 1154 Innocent, The
My Workbook is attached.
SampleWorkbook.xlsm
Here is the code I would like to amend. It is located in Module 2 for testing purposes. When it is correct, it will be added to the Forms: frmTest code.
As I said, I am a novice at writing code and would appreciate any suggestions being explained. Thank you in advance for your help.
Bookmarks