+ Reply to Thread
Results 1 to 3 of 3

Find the row number of the first cell entry in a column

  1. #1
    Registered User
    Join Date
    12-05-2007
    Posts
    7

    Find the row number of the first cell entry in a column

    When I do a sort with a macro key, I always get a number of blank rows above the first row with any data. I would like to automatically determine how many rows there are until my first row of data and then delete these rows automatically by editing the VBA code of my sort macro Sub.

    I have be trying something like row(3,cell(value,$a$1)) and then deleting these rows where $a$1 is where I am trying to calculate where that first data row is, but it is not working consistantly.

    My sort range will also give me a large number of blank rows after the rows of data are sorted together which is adding to the complexity for me.

    Any ideas would be greatly appreciated.
    Last edited by catmandu57; 03-10-2008 at 11:15 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I think your spreadsheet design needs looking at. Can you attach a small zipped example workbook with your curent layout & code?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    12-05-2007
    Posts
    7

    Smile

    Thanks for looking at my question. I think that I may have stumbled on to a workable answer with the following:

    Please Login or Register  to view this content.
    It actually starts at the third row in my sorted spreadsheet, finds the first cell that has data in column C (my sort data column) goes up one row, and then deletes all of the blank rows that were sorted above my actual data but below my header rows (1,2 & 3).

    Thanks again

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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