xlFirstRow = 256, why? RRS feed

  • Question

  • Hello,

    I am debugging VBA code written by a colleague who has now left the company. I think I have pin pointed the cause of a major bug to be the pre defined function xlFirstRow, which in theory returns the value of teh first occupied row. This is not the case, the function is returning 256. I want to know why it is returning this value?

    Thanks in advance for any help.

    Christian Taylor

    Monday, October 13, 2014 11:06 AM

All replies

  • Hi Christian,

    Can you post xlFirstRow function code and specify data in the sheet.

    Monday, October 13, 2014 11:11 AM
  • Hello,

    I cannot post the code for the function as I cannot see it. It is a member of the XIPTSelectionMode class if it helps?

    Monday, October 13, 2014 11:21 AM
  • Right Click on xlFirstRow and select Definition to get code of the function. 

    It seems that code might be ok, but data in the sheet might have changed 

    Monday, October 13, 2014 12:29 PM
  • Hello,

     I have done this, but all I can see is: 

    Const xlFirstRow = 256 (&H100)
        Member of Excel.XlPTSelectionMode


    Monday, October 13, 2014 12:50 PM
  • yes xlFirstRow has 250 as default value, please see details for default values in below link.

    and example in this link where pivot table selection mode is changed.

    Can you post the code where xlfirstrow is mentioned to get clear picture?

    • Edited by Amol Gargote Monday, October 13, 2014 1:22 PM Link missed
    Monday, October 13, 2014 1:17 PM
  • Line of code:

    iRowCounter = xlFirstRow + 3 

    Monday, October 13, 2014 2:29 PM