+ Reply to Thread
Results 1 to 5 of 5

VBA Delete Code not running in full program

  1. #1
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    882

    VBA Delete Code not running in full program

    Can anyone tell me why the code below isnt working in the full program(Afraid it is not a part I wrote but I got from a forum and so don't fully understand it all yet) ?

    Please Login or Register  to view this content.
    It should delete the"------" lines out of the spreadsheet but isn't. I tried running just the array part of the code up to the relevant point, got the result and then used this to put the code in by itself and it seems to run fine (See result in ALCOHOL MASTER2) but when it is in the full code below the end result has the "------" still in the last column. I am sure I am missing something stupid but can't see it. Any help please would be appreciated..The proper full code is in ALCRUN2 and the text file needed is ALCOHOL MASTER.txt. Obviously you will need to change the path to run it.
    Complete full code below.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: VBA Delete Code not running in full program

    Hello paul555555,

    Not all of the data doesn't seems to align correctly on the worksheet. Which parts of the text file need to be transferred to the workbook?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    882

    Re: VBA Delete Code not running in full program

    I have attached a file book1 which is how the spreadsheet should end-up. The program takes the info from the line line in the text file that has the word "TRANS" in it with the exception of the last column which takes its info from the line a few rows above which has a similar name on the product. In this case
    978 AU13G02 61970 Russian Standard 70cl 6 0 13 13 13
    Hope that helps. The program seems to run correctly at home i.e. aligning correctly. The only problem I am getting is why it doesn't want to take out the dashes which is the problem mentioned above with the deletion part of the program. The transferring of the information from the text file is working fine it is only the deletion part that is causiing the problem.
    Attached Files Attached Files
    Last edited by WasWodge; 11-03-2010 at 11:33 PM. Reason: clarification

  4. #4
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    882

    Re: VBA Delete Code not running in full program

    just to show how the program works a n bit clearer I posted a adapted text file so you can see how the program works on a product which doesn't have the headers above the row and an end result sheet on how it is currently running on the adapted file
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    882

    Re: VBA Delete Code not running in full program

    I have posted a word doc version of the text file so I could highlight where the code extracts from. I have to get ready for work in a minute so won't be able to reply to any posts until this evening.
    Attached Files Attached Files

+ 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