I have created some VB code for deleting a row (See attached Equipment Return Log, on ReturnData sheet. Clicking Delete Row will remove the row containing an active cell). However when a row gets deleted it effects my A column formula which list the record number with the following formula:
=IFERROR(IF($D7="", " ", $A6+1), "")
When the row is deleted, the A cell formula in the row below changes to:
=IFERROR(IF($D7="", " ",#REF!+ 1), "")
and no longer displays the record number for any rows below.
I tried changing this formula to the following code (attachment Equipment Return Log2):
=IFERROR(IF($D7="","",INDIRECT(ADDRESS(ROW()-1,COLUMN()))+1),"")
While this fixes the issue of the record number not working when the records are deleted it prevents some vlookup code from working on the Search sheet. If you go down to row 334, (which contains the last record from the ReturnData sheet) it starts adding blank records. When using the delete record macro the A column on ReturnData sheet now appears to correctly list all the record numbers below, however on the Search sheet a blank row gets left behind where that record used to be, and the Record number on that page stops working from that row on.
Im not sure if the issue is with the record number forumla on the A column, the vlookup formula on the Search page, or both. And I dont see how the Column A formula on ReturnData! is effecting the vlookup formula on Search! since the vlookup code only references columns D to K.
Thank you for your time,
James
Bookmarks