+ Reply to Thread
Results 1 to 2 of 2

Query.add issue

  1. #1
    Registered User
    Join Date
    11-13-2005
    Posts
    21

    Query.add issue

    I am wrinting a macro to import data from a text file. I thought it would be a simple record macro and go. Everything works fine except for one aspect that I have been unable to figure out. I have an excel file that I would like to import a file into on a daily basis. The thing that I cannot figure out is when I do the import, it shifts the previous imports over by the width of the new import.

    So the macro has the first blank row set as the destination for the query.add. The first run imports the data into A1. Assume there are 5 rows and 5 columns af data. The next run will put the data at A6, but it will shift rows 1 through 5 over by 5 columns. Each time I run the macro it will go down the correct 5 rows, but everything gets shifted right 5 columns.

    I am assuming this has something to do inherently with the "add" part. Is there someway to turn this off? If I do not use a macro, but just do two data imports by hand, the second one does not shift anything.

    Here is the code I am using. It is a straight macro recording except for the destination.

    Please Login or Register  to view this content.
    Thanks.
    Last edited by nakedbamboo; 10-07-2011 at 11:30 AM. Reason: adding code

  2. #2
    Registered User
    Join Date
    11-13-2005
    Posts
    21

    Re: Query.add issue

    Has anyone else seen anything like this, or am I experiencing this on my own? Am I just going to have to hard code something that selects the inserted cells and deletes them? I would assume there should be some way to do this without having the cells inserted, but I can't figure it out.

    Thanks for any help.

+ 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