+ Reply to Thread
Results 1 to 6 of 6

VBA script - Multiple copies of each Row (problem).

  1. #1
    Registered User
    Join Date
    02-11-2013
    Location
    Daugavpils
    MS-Off Ver
    Excel 2003
    Posts
    10

    VBA script - Multiple copies of each Row (problem).

    Dear all,

    My name is Alex and I am new to this forum. I have a very limited knowledge of Visual Basics, and I would be very glad if you could assist me with the following problem I have encountered.

    I have an Excel database where I keep a record of all incoming calls to our organization (orders and general inquiries). In order to help me manage this database I decided to write a VBA script, which would split the entire database according to the name of the city the call was received from. There are only 4 (four) different cities in my database (these are the cities our business is operating in). Now, although my script works well (in a sense that it splits the entire database according to the city names), it has one major drawback - it creates multiple copies of each row whenever I run the script. Therefore, I was hoping that maybe someone from this community could help me to resolve this issue.

    Here's my code:

    Please Login or Register  to view this content.
    And here's the link to the actual Excel file I am talking about.

    Thank you very much in advance.

    UPDATE: As far as I understand, one way of achieving the desired effect is to add one more line of code, which would add some sort of indication that this particular Row has already been Exported to the required Sheets. Hence, I could add additional Column in my database and name it "Indicator", which would store the information about the records which have already been exported. This is just a thought, if there's a better (less cluttered and efficient way) of achieving the desired effect, please let me know. Any help will be highly appreciated.
    Attached Files Attached Files
    Last edited by akarev; 02-12-2013 at 10:00 AM.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA script - Multiple copies of each Row (problem).

    Try this one

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-11-2013
    Location
    Daugavpils
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: VBA script - Multiple copies of each Row (problem).

    Quote Originally Posted by AB33 View Post
    Try this one

    Please Login or Register  to view this content.
    Hi AB33,

    Thank you very much for your help! It works like a charm! I can't believe that you did all this in such a short period of time (it would definitely take me at least a year to figure it out myself). I thought that the code will be much simpler, but it looks so complicated, but works perfect!

    Once again, thank you very much for your help, you really really helped me!

    Sincerely,

    Alex

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA script - Multiple copies of each Row (problem).

    Alex,
    Glad to be helpful and you are welcome!
    Next time, please do not reply with Quote, it does not have any purpose but to clutter this space. Just click "Reply"
    Could you please now close this thread as solved. Go in to the top right-hand side of this page, choose "Thread Tools", select solved from the drop down menu.

  5. #5
    Registered User
    Join Date
    02-11-2013
    Location
    Daugavpils
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: VBA script - Multiple copies of each Row (problem).

    Done. I have also added you some sort of "reputation". Not exactly sure what this is, but hey, why not

    Thanks.

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA script - Multiple copies of each Row (problem).

    Alex,

    Thanks again for "Rep"

+ 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