Extracting the number just after a text from textpad and writing in columns in excel
Page 3 of 3 FirstFirst 123
Results 21 to 28 of 28

Thread: Extracting the number just after a text from textpad and writing in columns in excel
Thanks Thanks: 0 Likes Likes: 0

  1. #21
    MrExcel MVP Rick Rothstein's Avatar
    Join Date
    Apr 2011
    Location
    New Jersey, USA
    Posts
    34,956
    Post Thanks / Like
    Mentioned
    91 Post(s)
    Tagged
    33 Thread(s)

    Default Re: Extracting the number just after a text from textpad and writing in columns in excel

    I am having trouble following who all of your posts are responding to. Just out of curiosity, After deciding that the numbers can be displayed in normal number format, did the code I posted in Message #6 work for you or not? If not, in what way did it fail to do what you wanted?
    Rick's "mini" blog... http://www.excelfox.com/forum/f22/
    .
    Want to post a small screen shot? See Part B here.

  2. #22
    Board Regular alansidman's Avatar
    Join Date
    Feb 2007
    Location
    Steamboat Springs
    Posts
    4,858
    Post Thanks / Like
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Extracting the number just after a text from textpad and writing in columns in excel

    Let me know if that works for you
    Alan

    Am Yisrael Chai

    Win 10--Office 2019
    When Posting Code, please use code tags.
    How to insert Mcode to Power Query https://excel.solutions/2017/11/powe...te-code-video/


  3. #23
    New Member
    Join Date
    May 2019
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Extracting the number just after a text from textpad and writing in columns in excel

    Sorry for the confusion Rick. I have replied for your code in #20 . Thank you so much for the help .. it would be highly appreciable if you can replay the doubt in #20
    Thank you in advance

  4. #24
    New Member
    Join Date
    May 2019
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Extracting the number just after a text from textpad and writing in columns in excel

    Alansidman,​ thank you so much for the link .. I'll surely work on it..
    Last edited by xsdip; May 22nd, 2019 at 06:05 PM.

  5. #25
    New Member
    Join Date
    May 2019
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Extracting the number just after a text from textpad and writing in columns in excel

    Dante Amor, Thank you so much for the learning ... highly appreciable ..
    Last edited by xsdip; May 22nd, 2019 at 06:04 PM.

  6. #26
    Board Regular DanteAmor's Avatar
    Join Date
    Dec 2018
    Location
    México
    Posts
    5,199
    Post Thanks / Like
    Mentioned
    49 Post(s)
    Tagged
    14 Thread(s)

    Default Re: Extracting the number just after a text from textpad and writing in columns in excel

    Quote Originally Posted by xsdip View Post
    Dante Amor, Thank you so much for the learning ... highly appreciable ..
    Again with pleasure. Thanks for the feedback
    Regards Dante Amor

  7. #27
    MrExcel MVP Rick Rothstein's Avatar
    Join Date
    Apr 2011
    Location
    New Jersey, USA
    Posts
    34,956
    Post Thanks / Like
    Mentioned
    91 Post(s)
    Tagged
    33 Thread(s)

    Default Re: Extracting the number just after a text from textpad and writing in columns in excel

    Quote Originally Posted by xsdip View Post
    Sorry for the confusion Rick. I have replied for your code in #20 . Thank you so much for the help .. it would be highly appreciable if you can replay the doubt in #20
    Thank you in advance
    Here is my code with some explanatory comments which I hope will help you follow the logic behind the code...
    Code:
    Sub DisplayIDandTequal()
      Dim X As Long, FileNum As Long, TotalFile As String, IDs() As String
      
      ' The following section reads the entire file into
      ' the TotalFile string variable in one fell swoop
      FileNum = FreeFile
      Open "C:\TEMP\DisplayIDandT.txt" For Binary As #FileNum 
        TotalFile = Space(LOF(FileNum))
        Get #FileNum , , TotalFile
      Close #FileNum 
      
      ' This line of code creates an array using the text
      ' "DISPLAY ID" as the delimiter. This means starting
      ' with the second element of the array, each element
      ' starts with the display ID number and includes the
      ' associated time value
      IDs = Split(TotalFile, "DISPLAY ID")
      
      ' This section loops through each of the elements
      ' identified above, one at a time. The Val function
      ' retrieves the number at the beginning of a text
      ' string and ignores the remainder of the text. Hence,
      ' the ID number is pulled from the beginning of the
      ' element and assigned to Column A. That element is
      ' then split on the text "T=" leaving the 2nd element
      ' starting with the time number which the Val function
      ' retrieves and assigns to Column B.
      For X = 1 To UBound(IDs)
        Cells(X, "A").Value = Val(IDs(X))
        Cells(X, "B").Value = Val(Split(IDs(X), "T=")(1))
      Next
    End Sub
    Last edited by Rick Rothstein; May 22nd, 2019 at 07:22 PM.
    Rick's "mini" blog... http://www.excelfox.com/forum/f22/
    .
    Want to post a small screen shot? See Part B here.

  8. #28
    New Member
    Join Date
    May 2019
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Extracting the number just after a text from textpad and writing in columns in excel

    Hi Rick,


    Thank you so much for the explanation.. I have one more doubt in that..when I have added some more words tto search using val function, I have got OVERFLOW Error.. Why is it so??

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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