Results 1 to 3 of 3

Row delete macro is effecting record count formula and vlookup code.

Threaded View

  1. #1
    Forum Contributor
    Join Date
    09-16-2013
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2011
    Posts
    620

    Row delete macro is effecting record count formula and vlookup code.

    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
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 01-03-2013, 01:13 AM
  2. [SOLVED] vba code to record a macro
    By green fox in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-11-2006, 05:50 PM
  3. [SOLVED] Macro Effecting Formatting
    By whornak in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-19-2005, 06:10 PM
  4. [SOLVED] how to get a macro to record F2, Home, Delete keystrokes
    By jenonstx in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2005, 02:05 AM
  5. Pilgrim needs help: Effecting keystroks required by a macro nested within a macro.
    By borsheim@sprynet.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-13-2005, 11:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1