Page 7 of 9 FirstFirst ... 56789 LastLast
Results 61 to 70 of 86

Thread: Copy Paste based on comparisons calculations in 2 XL files, 1 might be .csv file .Opened in XL=Fail/Chaos

  1. #61
    Senior Member
    Join Date
    Jul 2019
    Posts
    382
    Rep Power
    0
    Yes Doc Sir, I am getting that Error Again

  2. #62
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,455
    Rep Power
    10
    Run this macro in the uploaded file ( remember to change the file path and name to suit )
    Then save the file and return it to me

    Code:
    Sub OpenSample2_csv_8June() '
    Dim Ws1 As Worksheet: Set Ws1 = ThisWorkbook.Worksheets.Item(1)
    Dim FilePathandName As String
     Let FilePathandName = ThisWorkbook.Path & Application.PathSeparator & "Sample2.csv" ' ' CHANGE TO SUIT
    Dim FileNum As Long: Let FileNum = FreeFile(1)                                                                          ' https://msdn.microsoft.com/en-us/vba/language-reference-vba/articles/freefile-function
    Dim RwCnt As Long, TextFileLineIn As String
     Open FilePathandName For Input As #FileNum 'Open Route to data
        Do While Not EOF(FileNum)
         Line Input #FileNum, TextFileLineIn
         Let Ws1.Range("A" & Ws1.Range("A" & ActiveSheet.Rows.Count & "").End(xlUp).Row + 1 & "").Value = Left(TextFileLineIn, 4)
         Let Ws1.Range("B" & ActiveSheet.Range("B" & Ws1.Rows.Count & "").End(xlUp).Row + 1 & "").Value = Len(TextFileLineIn)
        Loop
    
     Close #FileNum
    End Sub




    Test2csvContents.xls : https://app.box.com/s/2knx1msb84ga5phpictm0c6bjcdnai6f
    Last edited by DocAElstein; 06-08-2020 at 08:26 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    _...KILL A MODERATOR!!

  3. #63
    Senior Member
    Join Date
    Jul 2019
    Posts
    382
    Rep Power
    0
    Plz See
    Attached Files Attached Files

  4. #64
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,455
    Rep Power
    10
    Please use the file I uploaded
    https://excelfox.com/forum/showthrea...ll=1#post13591
    and after running the macro, return the file to me

    Quote Originally Posted by DocAElstein View Post
    Run this macro in the uploaded file .....
    Then save the file and return it to me
    ( change the path to suit in the macro in the uploaded file )
    Last edited by DocAElstein; 06-08-2020 at 09:15 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    _...KILL A MODERATOR!!

  5. #65
    Senior Member
    Join Date
    Jul 2019
    Posts
    382
    Rep Power
    0
    Plz see
    Attached Files Attached Files

  6. #66
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,455
    Rep Power
    10
    You are not using the file that you uploaded in post #1
    I need the file that you are using!!!
    Quote Originally Posted by DocAElstein View Post
    Please upload the text file ( the file with .csv at the end of its name) that you are using........
    _____ Workbook: Test2csvContentsReturn.xls ( Using Excel 2007 32 bit )
    Avinash File Yous are using Alan File You uploaded in post #1
    NSE,
    26
    NSE,30,6,<,12783,A,,,,,GTT NSE,
    43
    NSE,101010,6,<,12783,A,,,,,GTT,,,,,,,,,,,,,
    NSE,
    25
    NSE,28,6,<,1499,A,,,,,GTT NSE,
    39
    NSE,22,6,<,12783,A,,,,,GTT,,,,,,,,,,,,,
    NSE,
    25
    NSE,25,6,<,3282,A,,,,,GTT NSE,
    42
    NSE,17388,6,<,12783,A,,,,,GTT,,,,,,,,,,,,,
    NSE,
    24
    NSE,22,6,<,382,A,,,,,GTT ,100
    26
    ,100,,,,,,,,,,,,,,,,,,,,,,
    ,25,
    25
    ,25,,,,,,,,,,,,,,,,,,,,,,
    ,,,,
    23
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,
    23
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,
    23
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,
    23
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,
    23
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,
    23
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,
    23
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,
    23
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,
    23
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,
    23
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,
    53
    ,,,,,,,,,,,,,Only for understanding purpose,,,,,,,,,,
    ,,,,
    23
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,
    46
    ,,,,,,,,,,,,,Before runing the macro,,,,,,,,,,
    ,,,,
    23
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,
    43
    ,,,,,,,,,,,,,NSE,101010,6,<,12783,A,,,,,GTT
    ,,,,
    39
    ,,,,,,,,,,,,,NSE,22,6,<,12783,A,,,,,GTT
    ,,,,
    42
    ,,,,,,,,,,,,,NSE,17388,6,<,12783,A,,,,,GTT
    ,,,,
    23
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,
    23
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,
    23
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,
    23
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,
    45
    ,,,,,,,,,,,,,After runing the macro,,,,,,,,,,
    ,,,,
    23
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,
    23
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,
    23
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,
    43
    ,,,,,,,,,,,,,NSE,101010,6,<,12783,A,,,,,GTT
    ,,,,
    39
    ,,,,,,,,,,,,,NSE,22,6,<,12783,A,,,,,GTT
    ,,,,
    42
    ,,,,,,,,,,,,,NSE,17388,6,<,12783,A,,,,,GTT
    ,,,,
    26
    ,,,,,,,,,,,,,,100,,,,,,,,,
    ,,,,
    25
    ,,,,,,,,,,,,,,25,,,,,,,,,
    Worksheet: Sheet1
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    _...KILL A MODERATOR!!

  7. #67

  8. #68
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,455
    Rep Power
    10
    My macro assumed you had in the first field of the text file
    NSE
    But your latest file has either
    NSE
    Or
    "NSE

    This is your latest file:
    NSE,101010,6,<,12783,A,,,,,GTT
    NSE,22,6,<,12783,A,,,,,GTT
    NSE,17388,6,<,12783,A,,,,,GTT
    "NSE,",30,,,,,,,,,
    "NSE,",26,,,,,,,,,
    "NSE,",29,,,,,,,,,


    But that does not explain the error that you showed here : https://excelfox.com/forum/showthrea...ll=1#post13530 )


    My best guess is that the problem is that you have no idea most of the time what files you are using, since, for example this was rubbish:
    Quote Originally Posted by fixer View Post
    ...I am runing the macro on the same file which I uploaded here
    So the original error ( https://excelfox.com/forum/showthrea...ll=1#post13530 ) , probably came because you were using a different file again!!!




    So far you have been using at least 3 different files and telling me that they are the same one!!!



    _____ Workbook: Test2csvContents.xls ( Using Excel 2007 32 bit )
    Text file You uploaded in post #15 text file You were using post #13 Text file You uploaded in post #1
    NSE,101010,6,<,12783,A,,,,,GTT NSE,30,6,<,12783,A,,,,,GTT NSE,101010,6,<,12783,A,,,,,GTT,,,,,,,,,,,,,
    NSE,22,6,<,12783,A,,,,,GTT NSE,28,6,<,1499,A,,,,,GTT NSE,22,6,<,12783,A,,,,,GTT,,,,,,,,,,,,,
    NSE,17388,6,<,12783,A,,,,,GTT NSE,25,6,<,3282,A,,,,,GTT NSE,17388,6,<,12783,A,,,,,GTT,,,,,,,,,,,,,
    "NSE,",30,,,,,,,,, NSE,22,6,<,382,A,,,,,GTT ,100,,,,,,,,,,,,,,,,,,,,,,
    "NSE,",26,,,,,,,,, ,25,,,,,,,,,,,,,,,,,,,,,,
    "NSE,",29,,,,,,,,, ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,,,,,,,,,,Only for understanding purpose,,,,,,,,,,
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,,,,,,,,,,Before runing the macro,,,,,,,,,,
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,,,,,,,,,,NSE,101010,6,<,12783,A,,,,,GTT
    ,,,,,,,,,,,,,NSE,22,6,<,12783,A,,,,,GTT
    ,,,,,,,,,,,,,NSE,17388,6,<,12783,A,,,,,GTT
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,,,,,,,,,,After runing the macro,,,,,,,,,,
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,,,,,,,,,,,,,,,,,,,,
    ,,,,,,,,,,,,,NSE,101010,6,<,12783,A,,,,,GTT
    ,,,,,,,,,,,,,NSE,22,6,<,12783,A,,,,,GTT
    ,,,,,,,,,,,,,NSE,17388,6,<,12783,A,,,,,GTT
    ,,,,,,,,,,,,,,100,,,,,,,,,
    ,,,,,,,,,,,,,,25,,,,,,,,,
    Worksheet: Sheet1

    Further....
    In post #11 you must have used a different file to any of those 3, so we have at least 4 different files that you are using,

    It continues to be almost impossible to help you because you either understand almost nothing I write, or you ignore almost all I write.
    You quickly post rubbish in post replies.
    You continue to waste everybody’s time, including your own!!
    Last edited by DocAElstein; 06-08-2020 at 10:56 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    _...KILL A MODERATOR!!

  9. #69
    Senior Member
    Join Date
    Jul 2019
    Posts
    382
    Rep Power
    0
    I Used in post #13
    is different
    what i have done i placed the macro in a book1.xlsm file & i changed the path in the code & i got this result after runing the macro in book1.xlsm & save the book1.xlsm & sent u the book1.xlsm file
    So that was my mistake i ran ur macro incorrectly

  10. #70
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,455
    Rep Power
    10
    So, currently , at this point in time, I have no idea what you want because, as usual, you are posting a lot of mixed up rubbish.

    I am happy to help further.

    But you are going to have to try to explain in English what the problem is.
    Take your time, and think carefully, and try to explain.
    Stop posting quick nonsense replies.


    No one anywhere can help if you continue to post a lot of mixed up rubbish in your replies.
    Last edited by DocAElstein; 06-08-2020 at 11:32 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    _...KILL A MODERATOR!!

Similar Threads

  1. Replies: 26
    Last Post: 09-26-2020, 05:56 PM
  2. Copy paste data based on criteria
    By analyst in forum Excel Help
    Replies: 7
    Last Post: 01-13-2014, 12:46 PM
  3. Replies: 8
    Last Post: 10-31-2013, 12:38 AM
  4. Replies: 2
    Last Post: 09-18-2013, 12:30 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •