+ Reply to Thread
Results 1 to 6 of 6

offset function not populating - run time 1004 error

  1. #1
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Usually at work, in the UK
    MS-Off Ver
    Excel 2010
    Posts
    640

    offset function not populating - run time 1004 error

    HR1 is a defined file path to spreadsheet, HR is the name of the Userform, Initials is the name of the textbox within HR.

    I am attempting to move down column C if C4 is not empty until I find the last full cell then move down to the empty one below it however I keep getting an error on the last row of the code. Can anyone tell me what I am doing wrong as it's driving me crazy?

    Error message is "Application-defined or object-defined error", still trying to understand these error messages.


    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Usually at work, in the UK
    MS-Off Ver
    Excel 2010
    Posts
    640

    Re: offset function not populating - run time 1004 error

    This is the full code if it helps

    Please Login or Register  to view this content.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: offset function not populating - run time 1004 error

    The problem is probably because with xlDown you are going right to the last row in the sheet, and then with the Offset trying to move one row beyond.

    Where do you want the data to go?

    Do you have header rows, for example in row 3?
    If posting code please use code tags, see here.

  4. #4
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Usually at work, in the UK
    MS-Off Ver
    Excel 2010
    Posts
    640

    Re: offset function not populating - run time 1004 error

    yes, header rows in row 3, data input from row 4 downwards. Want to find the last row with data (below row 4) and insert data below it.

    I tried range ("C:C"),xlup but that didn't work either

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: offset function not populating - run time 1004 error

    Try this.
    Please Login or Register  to view this content.
    Note with this code you really wouldn't need the If that's checking if there is data in row 4.

  6. #6
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Usually at work, in the UK
    MS-Off Ver
    Excel 2010
    Posts
    640

    Re: offset function not populating - run time 1004 error

    You the man Norie, cheers

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] "Run-time error '1004': App-dfnd or objt-dfnd err" Debug highlights ActiActiveCell.offset
    By GMAGANA in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-29-2014, 03:25 PM
  2. Run time error '1004' when populating pivot table
    By Orongo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-22-2012, 07:29 AM
  3. Run time error 1004 unable to get the vlookup property of the worksheet function class
    By surajitbose in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-13-2012, 06:12 PM
  4. 'Run time error '1004' on ActiveCell.Offset(1, 0).Select
    By perbags in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-02-2010, 01:37 PM
  5. range.offset generates a Run Time error 1004
    By nospamretmster@googlemail.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-22-2006, 12:50 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