+ Reply to Thread
Results 1 to 7 of 7

troubleshoot xlUp xlDown error 1004

  1. #1
    Registered User
    Join Date
    12-13-2010
    Location
    Hull
    MS-Off Ver
    Excel 2003
    Posts
    2

    troubleshoot xlUp xlDown error 1004

    Hi,
    The enclosed code splits text into two columns and autofills down the formula for all the rows that contain data.

    The text in column A may look something like this:-

    Jim Smith 01/12/2009
    Francis Marie Johnson 12/01/2010
    Mike 13/01/2010

    It separates the data by taking the last 10 charatacters and converting them to a date, and the preceding characters appear in a column on their own.


    When running the macro on most computers it works fine, but on one particular computer a user gets an Error 1004 Application Defined Error. It seems to fail when finding the top or bottom cell in the range and cannot autofile down because of this.

    Any suggestions as to why this may not work on all computers?

    Please Login or Register  to view this content.

    Thanks,
    LowSociety
    Last edited by LowSociety; 12-14-2010 at 06:41 AM. Reason: Solved - solution propvided by Jerry Beaucaire

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: troubleshoot xlUp xlDown error 1004

    I think that computer runs Excel 2007 ?



  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: troubleshoot xlUp xlDown error 1004

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    Hope that helps.

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

    Free DataBaseForm example

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: troubleshoot xlUp xlDown error 1004

    You've got lots of selecting and working with the activecell which is generally not necessary.

    Does this do what you want?

    Please Login or Register  to view this content.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: troubleshoot xlUp xlDown error 1004

    This should work on all your systems.
    Please Login or Register  to view this content.

    If I guessed at the columns to insert incorrectly, edit that...
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  6. #6
    Registered User
    Join Date
    10-11-2007
    Posts
    5

    Re: troubleshoot xlUp xlDown error 1004

    That particular PC has Option Explicit on top of the macro.
    Then you should define "LASTROW".

    Dim LASTROW As Long.

  7. #7
    Registered User
    Join Date
    12-13-2010
    Location
    Hull
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: troubleshoot xlUp xlDown error 1004

    Thanks for the replies so far. I will get my colleague to try the solutions provided.
    If this doesn't work, I will repost with an attatched example workbook.

    I really appreciate the prompt responses, and particularly, the help in tidying up the unnecessary code.

+ 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