+ Reply to Thread
Results 1 to 2 of 2

Runtime Error '1004' At Range Selection

  1. #1
    Registered User
    Join Date
    08-20-2008
    Location
    London, United Kingdom
    Posts
    5

    Question Runtime Error '1004' At Range Selection

    Greetings All,

    I'm working on a VBA macro to rapidly import a series of data sets from delimited text file. The idea is that I import the data into the 'Import' worksheet, wherein a number of variables (n, h, f and d) are calculated using worksheet functions. I then use these calculated variables in conjunction with a loop to copy and paste each data set into another worksheet.

    Please Login or Register  to view this content.
    As you can probably see the loop cycles through n number of times (i.e. once for each data set). For some reason however I keep getting a run-time error(s) at the highlighted line, an oddity since this line is almost identical for the earlier line of code outside of the loop. This is the specific error I recieve:

    Run-time Error '1004':

    Application-defined or object-defined error
    Can anyone see any glaring errors in there that I've missed? I am rather new to VBA afterall. I'm told that using select is unwise in these circumstances, so I would also appreciate it if someone better verse with VBA could demonstrate how to copy a range from one worksheet to a range in another. Put obviously the more pressing matter at present is getter the loop working, I had it working at some point yesterday, but for the life of me I cannot think how I got it working and/or what I did to break it!

    Any assistance would be greatly appreciated.

    Kind Regards,

    Anubeon.
    Last edited by Anubeon; 10-18-2009 at 11:06 AM. Reason: Rewording the Title

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

    Re: Having difficulties with looped data import macro.

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    Please remove unnecessary wording - having difficulty with
    Hope that helps.

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

    Free DataBaseForm example

+ 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