+ Reply to Thread
Results 1 to 4 of 4

WHAT TO CLICK ON TO DETECT END OF DATA IN A MACRO? Need to enter new record at end of data

  1. #1
    Registered User
    Join Date
    11-02-2012
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Exclamation WHAT TO CLICK ON TO DETECT END OF DATA IN A MACRO? Need to enter new record at end of data

    Each time I have to macro a macro to enter a new record my first clicks with Relative Reference toggled is "Ctrl arrow down", then "arrow down" BUT for this to work before starting the macro I have to enter one "dirty record" like "asdfg" so that Excel can detect "end of data". I want to find out how can I detect the end of that WHEN ADDING THE VERY FIRST RECORD in a macro. I need a solution to this in terms of what to click on, not a VBA code. Can someone help?

  2. #2
    Registered User
    Join Date
    10-17-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: WHAT TO CLICK ON TO DETECT END OF DATA IN A MACRO? Need to enter new record at end of

    Instead of making the code start from the top and find the last row with data, you can start from the bottom of the entire spreadsheet and go up to the last row with data. This way if there is no data in a column, it can still be placed in a row without erroring out. The code below should work without issue. However, it will place the first set of data on a blank column in row 2. If you want to get around this you would need to use an if statement.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-02-2012
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: WHAT TO CLICK ON TO DETECT END OF DATA IN A MACRO? Need to enter new record at end of

    NOTE: I am not good with VBA codes....can you let me know what I click on the keyboard while recording the macro so that it inserts the first row right below the title and then the second row below the first, and so on? When I click Ctrl arrow down it does find the end of data but the problem is that to record the first row I have to enter fake data so that ctrl arrow down find the end of data.... I don't want to have to enter a first fake row anymore

  4. #4
    Registered User
    Join Date
    10-17-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: WHAT TO CLICK ON TO DETECT END OF DATA IN A MACRO? Need to enter new record at end of

    The code that I provided does what you asked. All that you would need to do is change the column letter A to whatever column that you are trying to place data into and then change the 100 to whatever the value is that you want the cell to have. You can repeat the line of code as many times as needed and change the column and value each time to populate each column that you want to have data.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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