Page 2 of 55 FirstFirst 12341252 ... LastLast
Results 11 to 20 of 549

Thread: Tests Copying pasting Cliipboard issues

  1. #11
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,313
    Rep Power
    10

    HTML Code seen in Text Editor

    HTML as seen in Text Editor, for this Post:
    http://www.excelfox.com/forum/showth...0524#post10524

    OpenProMessageHTMLWithTextEditor.JPG : https://imgur.com/4zev9Kv

    ProMessageHTMLInTextEditor.JPG : https://imgur.com/eTUd17q


    Code:
    HTML Code:
    <body lang=DE style='tab-interval:35.4pt'>
    
    <div class=WordSection1>
    
    <p style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.0pt;
    font-family:"Times","serif";color:black'>T <span class=SpellE>Andale</span>
    Mono</span></p>
    
    <p style='margin:0cm;margin-bottom:.0001pt'><span style='color:red'> </span><span
    style='font-size:10.0pt;font-family:"Arial","sans-serif";color:red'>T Arial</span></p>
    
    <p style='margin:0cm;margin-bottom:.0001pt'><span style='font-family:"Arial Black","sans-serif";
    color:#FF9900'>T Arial Black</span></p>
    
    <p style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.0pt;
    font-family:"Comic Sans MS";color:#99CC00'>T Comic <span class=SpellE>Sans</span>
    MS</span></p>
    
    <p style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.0pt;
    font-family:"Courier New";color:#33CCCC'>T Courier New</span></p>
    
    <p style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.0pt;
    font-family:"Georgia","serif";color:#3366FF'>T Georgia</span></p>
    
    <p style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.0pt;
    font-family:"Helvetica","sans-serif";color:purple'>T <span class=SpellE>Helvetics</span></span></p>
    
    <p style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.0pt;
    font-family:"Impact","sans-serif";color:#999999'>T Impact</span></p>
    
    <p style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.0pt;
    font-family:"Tahoma","sans-serif";color:#993300'>T <span class=SpellE>Tahoma</span></span></p>
    
    <p style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.0pt;
    font-family:"monaco","serif";color:fuchsia'>T Terminal</span></p>
    
    <p style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.0pt;
    color:olive'>T Times New Roman</span></p>
    
    <p style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.0pt;
    font-family:"Trebuchet MS","sans-serif";color:#FF6600'>T <span class=SpellE>Trebuchet</span>
    MS</span></p>
    
    <p class=MsoNormalCxSpFirst><o:p> </o:p></p>
    
    <p class=MsoNormalCxSpMiddle><span style='font-size:9.0pt;line-height:115%;
    font-family:"Verdana","sans-serif";color:#C00000'>W9 <span class=SpellE>Verdana</span><o:p></o:p></span></p>
    
    <p class=MsoNormalCxSpMiddle><span style='font-family:"Arial Narrow","sans-serif";
    color:red'>W11 Arial <span class=SpellE>Narrow</span><o:p></o:p></span></p>
    
    <p class=MsoNormalCxSpMiddle><span style='font-size:14.0pt;line-height:115%;
    font-family:"Batang","serif";color:#FFC000'>W14 <span class=SpellE>Batang</span><o:p></o:p></span></p>
    
    <p class=MsoNormalCxSpMiddle><span style='font-size:16.0pt;line-height:115%;
    mso-ascii-font-family:Calibri;mso-fareast-font-family:Batang;mso-hansi-font-family:
    Calibri;color:#92D050'>W16 Calibri<o:p></o:p></span></p>
    
    <p class=MsoNormalCxSpMiddle><span style='font-size:18.0pt;line-height:115%;
    font-family:"Cambria Math","serif";mso-fareast-font-family:Batang;color:#00B050'>W18
    <span class=SpellE>Cambri</span> <span class=SpellE>Math</span><o:p></o:p></span></p>
    
    <p class=MsoNormalCxSpMiddle><span style='font-size:20.0pt;line-height:115%;
    font-family:FangSong;color:#00B050'>W20 <span class=SpellE>FangSong</span><o:p></o:p></span></p>
    
    <p class=MsoNormalCxSpMiddle><span style='font-size:22.0pt;line-height:115%;
    font-family:"Gungsuh","serif";color:#00B0F0'>W22 <span class=SpellE>Gungsuh</span><o:p></o:p></span></p>
    
    <p class=MsoNormalCxSpMiddle><span style='font-size:24.0pt;line-height:115%;
    font-family:GungsuhChe;color:#0070C0'>W24 <span class=SpellE>GungsuhChe</span></span><span
    style='font-size:24.0pt;line-height:115%;font-family:"Franklin Gothic Heavy","sans-serif";
    mso-fareast-font-family:Batang;color:#0070C0'> <o:p></o:p></span></p>
    
    <p class=MsoNormalCxSpMiddle><span style='font-size:26.0pt;line-height:115%;
    font-family:"Times New Roman","serif";mso-fareast-font-family:Batang;
    color:#002060'>W26 Times New Roman<o:p></o:p></span></p>
    
    <p class=MsoNormalCxSpLast><span style='font-size:28.0pt;line-height:115%;
    font-family:"Franklin Gothic Heavy","sans-serif";mso-fareast-font-family:Batang;
    color:#7030A0'>W28 Franklin <span class=SpellE>Gothic</span><span
    style='mso-spacerun:yes'>  </span>Heavy<o:p></o:p></span></p>
    
    </div>
    
    </body>
    
    </html>
    ….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!!

  2. #12
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,313
    Rep Power
    10

    Modified initial function and additional second function for German telekom EMail workaround

    Function codes discussed in this Post:
    http://www.excelfox.com/forum/showth...0527#post10527






    Code:
    Public Function MyLengthyStreaming() As String
    Rem 1 Make a long string from a Microsoft Word doc
    '1(i) makes available the Library of stuff, objects, Methods etc.
    Dim Fso As Object: Set Fso = CreateObject("Scripting.FileSystemObject")
    '1(ii) makes the big File Object                       " Full path and file name of Word doc saved as .htm       "
    Dim FileObject As Object: Set FileObject = Fso.GetFile("G:\ALERMK2014Marz2016\NeueBlancoAb27.01.2014\AbJan2016\ProMessageTelekom.htm"): Debug.Print FileObject
    '1(iii) sets up the data  "stream highway"
    Dim Textreme As Object:  Set Textreme = FileObject.OpenAsTextStream(iomode:=1, Format:=-2)        '   reading only, Opens using system default            https://msdn.microsoft.com/en-us/library/aa265341(v=vs.60).aspx
    '1(iv) pulls in the data, in our case into a simple string variable
     Let MyLengthyStreaming = Textreme.ReadAll         '        Let MyLengthyStreaming = Replace(MyLengthyStreaming, "align=center x:publishsource=", "align=left x:publishsource=")
     Textreme.Close
     Set Textreme = Nothing
     Set Fso = Nothing
     Let MyLengthyStreaming = MyLenghtyDiesScreaming_Telekom(MyLengthyStreaming) ' After this code line is done we have the string modified so that it gives the correct results in German Telekom Freemail t-online.de
    Rem 2 possible additions to MyLengthyStreaming
    ' 
    '
    '
    '
    End Function
    '
    '  The second function below is mainly intended to make a modification to get the correct results in German Telekom Freemail t-online.de , but also the large html text not required from the start and a small amount at the end is also removed. (It does not need to be removed as it appears that it is ignored)
    Public Function MyLenghtyDiesScreaming_Telekom(ByVal MyLengfyScream As String) As String '  Effectively this Dim's  MyLenghtyDiesScreaming_Telekom  as a String variable and  MyLenghtyDiesScreaming_Telekom  can be used as such in this function code.  Assigning a variable to this in a main code will cause  the value held by VBA in the variable  MyLenghtyDiesScreaming_Telekom   at that point to be out in the assigned variable, but fist the main code will be paused at  this "calling"  code line whilst the Function code is carried out.  So we have the chance to do something in the function to fill that variable, MyLenghtyDiesScreaming_Telekom . We can take one or more things in in the ( ) to use . In this case we want to take a string in and then return it modified , hence the last code line is simply   MyLenghtyDiesScreaming_Telekom = MyLengfyScream
    Dim CntPus As Long '      A number constant for the positions of characters used in a couple of places.        Long is very simple to handle, - final memory "size" type is known (123.456 and 000.001 have same "size" computer memory ) , and so a Address suggestion can be given for the next line when the variable is filled in.  '( Long is a Big whole Number limit (-2,147,483,648 to 2,147,483,647) If you need some sort of validation the value should only be within the range of a Byte/Integer otherwise there's no point using anything but Long.--upon/after 32-bit, Integers (Short) need converted internally anyways, so a Long is actually faster. )       https://www.mrexcel.com/forum/excel-questions/803662-byte-backward-loop-4.html
    ' Take off all the first lot on unecessary required HTML
     Let CntPus = InStr(1, MyLengfyScream, "<div class=WordSection1>", vbTextCompare) '  return the position (starting from the fist character ,  Looking in the string  ,  for that text  ,  doing a text comparison which is case insensitive  )
     Let MyLengfyScream = Mid(MyLengfyScream, CntPus + 26)
    ' Add to this array below all possible fonts in quotes      I have to use Variant type as the VBA Array( ) Method used below pruduces a 1 dimmansional Array of Variant types.   I may assing a dynamic Array of variant types to what the VBA Array( ) Function returns
    Dim arsFonts() As Variant: Let arsFonts() = Array("""Andale Mono""", """Times""", """serif""", """Arial""", """sans-serif""", """Arial Black""", """Comic Sans MS""", """Courier New""", """Georgia""", """Helvetics""", """Impact""", """Tahoma""", """Terminal""", """monaco""", """Times New Roman""", """Trebuchet MS""", """Verdana""", """Arial Narrow""", """Batang""", """Calibri""", """Cambri Math""", """FangSong""", """Gungsuh""", """GungsuhChe""", """Franklin Gothic Heavy""")
    Dim arschFont As Variant ' It is a required syntax that the stearing element in the For Each loop to be Variant type or Object type, ( the object type can be  Object   or ther specific object. if I do not specify specifically then VBVA defaults to all simialr ngs in the thing you are going through                                                                        '  http://www.excelfox.com/forum/showthread.php/2157-Re-Defining-multiple-variables-in-VBA?p=10192#post10192
    ' Look for things like "Font"  and replace the " with an arbitrary string like ScrotumSack , so  "Font"  becomes  ScrotumSackFontScrotumSack
        For Each arschFont In arsFonts() ' Loop to look for and replce each Font held in "s with the same font but in 's
         If InStr(1, MyLengfyScream, arschFont, vbTextCompare) > 1 Then ' case a Font in quotes , like "font"  ,  so for that font in quotes... and ...
         Dim FontSingleScrQuote As String: Let FontSingleScrQuote = Replace(arschFont, """", "ScrotumSack", 1, 2, vbBinaryCompare) ' ...Make a that font in ScrotumSack  like ScrotumSackfontScrotumSack ... and ...     I use ScrotumSack arbitrarily as I find it funny and I doubt anyone else does.. does use it, so I won't have that already in the text. I cannot go straight to using the '  because if I do that now then I won't be able to distinguisch the existing ' which I want to change to "  in the next bit
          Let MyLengfyScream = Replace(MyLengfyScream, arschFont, FontSingleScrQuote, 1, -1, vbTextCompare) ' .... replace all "fonts" with ScrotumSackfontsScrotumSack
         Else '  no arsch Font in My lengfy scream
         End If
        Next arschFont
    ' replace any ' with "  This is mainly intended to replace enclosed in ' strings like   askjhhsa ='kasjhScrotumSackfontScrotumSackfcb qwq 63 = Bollocks' jdgsjag   with     askjhhsa ="kasjhScrotumSackfontScrotumSackfcb qwq 63 = Bollocks" jdgsjag
     Let MyLengfyScream = Replace(MyLengfyScream, "'", """", 1, -1, vbTextCompare)
    ' Scratch my Scrotum sacks, - that is to say replace them with a with  '   I can do this now since the existing  '  have been changeed to "  so the ScrotumSacks , which were originally "s , can now be chnged to 's
     Let MyLengfyScream = Replace(MyLengfyScream, "ScrotumSack", "'", 1, -1, vbTextCompare)
    ' take last unecessary bit of HTML off
     Let CntPus = InStrRev(MyLengfyScream, "</div>", -1, vbTextCompare) ' get the position counting from the left but looking from the right   ( in MyLengfyScream , of </div> , start looking from end , make text comparison which is case insensitive )
     Let MyLengfyScream = Left(MyLengfyScream, CntPus - 1)
    ' Finally we set here what is actually returned by virtue of effectively putting something in the pseudo variable  MyLenghtyDiesScreaming_Telekom
     Let MyLenghtyDiesScreaming_Telekom = MyLengfyScream
    End Function
    ….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. #13
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,313
    Rep Power
    10

    Code for RaghavendraPrabhu Make macro create unique files only once.If files exist amend them.

    Code for RaghavendraPrabhu
    For this Post in main Excel Forum
    http://www.excelfox.com/forum/showth...ist-amend-them

    Code:
    Option Explicit
    
    ' https://stackoverflow.com/questions/46368771/how-to-create-a-new-workbook-for-each-unique-value-in-a-column?rq=1
    ' http://www.excelfox.com/forum/showthread.php/2237-Make-macro-create-unique-files-only-once-If-files-exist-amend-them
    Sub ExportByName()
    Dim unique(1000) As String
    Dim wb(1000) As Workbook
    Dim ws As Worksheet
    Dim x As Long
    Dim y As Long
    Dim ct As Long
    Dim uCol As Long
    
    'On Error GoTo ErrHandler
    
    'Application.ScreenUpdating = False
    'Application.Calculation = xlCalculationManual
    
    'Your main worksheet
    Set ws = ActiveWorkbook.Sheets("Sheet1")
    
    'Column G
    uCol = 7
    ct = 0
    
    'get a unique list of users
    For x = 2 To ws.Cells(ws.Rows.Count, uCol).End(xlUp).Row
        If CountIfArray(ActiveSheet.Cells(x, uCol), unique()) = 0 Then
            unique(ct) = ActiveSheet.Cells(x, uCol).Text
            ct = ct + 1
        End If
    Next x
    
    'loop through the unique list
      For x = 0 To ws.Cells(ws.Rows.Count, uCol).End(xlUp).Row - 1
        If unique(x) <> "" Then
        If Dir(ThisWorkbook.Path & "\" & unique(x) & ".xlsx", vbNormal) = "" Then 'If unique file does not exist
            'add workbook
            Workbooks.Add: Set wb(x) = ActiveWorkbook
            ws.Range(ws.Cells(1, 1), ws.Cells(1, uCol)).Copy wb(x).Sheets(1).Cells(1, 1)
        Else ' open workbook
         Workbooks.Open Filename:=ThisWorkbook.Path & "\" & unique(x) & ".xlsx"
         Set wb(x) = ActiveWorkbook
        End If
    
            
            'loop to find matching items in ws and copy over
            For y = 2 To ws.Cells(ws.Rows.Count, uCol).End(xlUp).Row
                If ws.Cells(y, uCol) = unique(x) Then
                    'copy full formula over
                    'ws.Range(ws.Cells(y, 1), ws.Cells(y, uCol)).Copy wb(x).Sheets(1).Cells(WorksheetFunction.CountA(wb(x).Sheets(1).Columns(uCol)) + 1, 1)
                    'to copy and paste values
                    ws.Range(ws.Cells(y, 1), ws.Cells(y, uCol)).Copy
                    wb(x).Sheets(1).Cells(WorksheetFunction.CountA(wb(x).Sheets(1).Columns(uCol)) + 1, 1).PasteSpecial (xlPasteValues)
                    wb(x).Sheets(1).Cells(WorksheetFunction.CountA(wb(x).Sheets(1).Columns(uCol)), 6).Value = Format(Date, "dd mmm yyyy")
                End If
            Next y
            'autofit
            wb(x).Sheets(1).Columns.AutoFit
            'save when done
            wb(x).SaveAs ThisWorkbook.Path & "\" & unique(x) & ".xlsx", FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False     '   & " " & Format(Now(), "mm-dd-yy")
            wb(x).Close SaveChanges:=True
        Else
            'once reaching blank parts of the array, quit loop
            Exit For
        End If
    
      Next x
    ' Master File change to current date:
    Dim Lr As Long: Let Lr = ws.Cells(Rows.Count, 6).End(xlUp).Row
     ws.Range("F2:F" & Lr & "").Value = Format(Date, "dd mmm yyyy")
    
    ' Application.ScreenUpdating = True
    ' Application.Calculation = xlCalculationAutomatic
    
    ErrHandler:
    Application.ScreenUpdating = True
    Application.Calculation = xlCalculationAutomatic
    
    End Sub
    
    Public Function CountIfArray(lookup_value As String, lookup_array As Variant)
        CountIfArray = Application.Count(Application.Match(lookup_value, lookup_array, 0))
    End Function
    ….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!!

  4. #14
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,313
    Rep Power
    10

    Second Code for RaghavendraPrabhu Make macro create unique files only once.If files exist amend them.

    Second Code for RaghavendraPrabhu
    For this Post in main Excel Forum
    http://www.excelfox.com/forum/showth...0541#post10541



    Code:
    
    Option Explicit
    
    ' https://stackoverflow.com/questions/46368771/how-to-create-a-new-workbook-for-each-unique-value-in-a-column?rq=1
    ' http://www.excelfox.com/forum/showthread.php/2237-Make-macro-create-unique-files-only-once-If-files-exist-amend-them
    Sub ExportByName()
    Dim unique(1000) As String
    Dim wb(1000) As Workbook
    Dim ws As Worksheet
    Dim x As Long
    Dim y As Long
    Dim ct As Long
    Dim uCol As Long
    
    'On Error GoTo ErrHandler
    
    'Application.ScreenUpdating = False
    'Application.Calculation = xlCalculationManual
    
    'Your main worksheet info.
     Set ws = ActiveWorkbook.Sheets("Sheet1")
     Let uCol = 7 'Column G
    Dim Strt As Long, Stp As Long: Let Strt = ws.Cells(ws.Rows.Count, 6).End(xlUp).Row + 1: Stp = ws.Cells(ws.Rows.Count, uCol).End(xlUp).Row
     Let ws.Range("F" & Strt & ":F" & Stp & "").Value = Format(Date, "dd mmm yyyy") ' adding the dates to the new rows
     Let ws.Range("A" & Strt & ":A" & Stp & "").Value = Application.Evaluate("=row(" & Strt & ":" & Stp & ")-1") ' adding the S.no. to the new rows
    
    ct = 0
    
    'get a unique list of users
    For x = 2 To ws.Cells(ws.Rows.Count, uCol).End(xlUp).Row
        If CountIfArray(ActiveSheet.Cells(x, uCol), unique()) = 0 Then
            unique(ct) = ActiveSheet.Cells(x, uCol).Text
            ct = ct + 1
        End If
    Next x
    
    'loop through the unique list
      For x = 0 To ws.Cells(ws.Rows.Count, uCol).End(xlUp).Row - 1
        If unique(x) <> "" Then
        If Dir(ThisWorkbook.Path & "\" & unique(x) & ".xlsx", vbNormal) = "" Then 'If unique file does not exist
            'add workbook
            Workbooks.Add: Set wb(x) = ActiveWorkbook
            ws.Range(ws.Cells(1, 1), ws.Cells(1, uCol)).Copy wb(x).Sheets(1).Cells(1, 1)
        Else ' open workbook
         Workbooks.Open Filename:=ThisWorkbook.Path & "\" & unique(x) & ".xlsx"
         Set wb(x) = ActiveWorkbook
        End If
    
            
            'loop to find matching items in ws starting from where column F ( 6 )  has no entry and copy over
            'For y = ws.Cells(ws.Rows.Count, 6).End(xlUp).Row + 1 To ws.Cells(ws.Rows.Count, uCol).End(xlUp).Row
            For y = Strt To Stp
                If ws.Cells(y, uCol) = unique(x) Then
                    'copy full formula over
                    'ws.Range(ws.Cells(y, 1), ws.Cells(y, uCol)).Copy wb(x).Sheets(1).Cells(WorksheetFunction.CountA(wb(x).Sheets(1).Columns(uCol)) + 1, 1)
                    'to copy and paste values
                    ws.Range(ws.Cells(y, 1), ws.Cells(y, uCol)).Copy
                    wb(x).Sheets(1).Cells(WorksheetFunction.CountA(wb(x).Sheets(1).Columns(uCol)) + 1, 1).PasteSpecial Paste:=xlPasteValuesAndNumberFormats
                    'wb(x).Sheets(1).Cells(WorksheetFunction.CountA(wb(x).Sheets(1).Columns(uCol)), 6).Value = Format(Date, "dd mmm yyyy")
                End If
            Next y
            'autofit
            wb(x).Sheets(1).Columns.AutoFit
            'save when done
            wb(x).SaveAs ThisWorkbook.Path & "\" & unique(x) & ".xlsx", FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False     '   & " " & Format(Now(), "mm-dd-yy")
            wb(x).Close SaveChanges:=True
        Else
            'once reaching blank parts of the array, quit loop
            Exit For
        End If
    
      Next x
    '' Master File change to current date:
    'Dim Lr As Long: Let Lr = ws.Cells(Rows.Count, 6).End(xlUp).Row
    ' ws.Range("F2:F" & Lr & "").Value = Format(Date, "dd mmm yyyy")
    
    ' Application.ScreenUpdating = True
    ' Application.Calculation = xlCalculationAutomatic
    
    ErrHandler:
    Application.ScreenUpdating = True
    Application.Calculation = xlCalculationAutomatic
    
    End Sub
    
    Public Function CountIfArray(lookup_value As String, lookup_array As Variant)
        CountIfArray = Application.Count(Application.Match(lookup_value, lookup_array, 0))
    End Function
    ….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. #15
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,313
    Rep Power
    10

    Example VBA available checked Libraries Info, (Helpful for Later Early Binding)

    Some sample data for other Posts and Threads:
    http://www.excelfox.com/forum/showth...ing-Techniques

    Using this code: _..
    Code:
     Sub Its() ' snb 2017
    Dim It As Variant
      For Each It In ThisWorkbook.VBProject.References
      Dim strIts As String
       Let strIts = strIts & "Description:" & vbTab & It.Description & vbCr & "Name:" & vbTab & vbTab & It.Name & vbCr & "Buitin:" & vbTab & vbTab & It.BuiltIn & vbCr & "Minor:" & vbTab & vbTab & It.minor & vbCr & "Major:" & vbTab & vbTab & It.major & vbCr & "FullPath:" & vbTab & vbTab & It.fullpath & vbCr & "GUID:" & vbTab & vbTab & It.GUID & vbCr & "Type:" & vbTab & vbTab & It.Type & vbCr & "Isbroken:" & vbTab & vbTab & It.isbroken & vbCr & vbCr
      Next It
    Debug.Print strIts ' From  VB Editor Ctrl+g  to get Immediate Window from which info can be copied
    End Sub
    _.. you can get text displayed in the Immediate Window which you can copy.




    Some example VBA available checked Libraries:
    VBACheckedAvailableLibraries_1.JPG : https://imgur.com/scnHhHR
    Attachment 1992
    Here below the code output based on running in a Workbook which has the libraries checked as in the above screenshot:
    Code:
    Description:    Visual Basic For Applications
    Name:       VBA
    Buitin:     Wahr
    Minor:      0
    Major:      4
    FullPath:       C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL
    GUID:       {000204EF-0000-0000-C000-000000000046}
    Type:       0
    Isbroken:       Falsch
    
    Description:    Microsoft Excel 12.0 Object Library
    Name:       Excel
    Buitin:     Wahr
    Minor:      6
    Major:      1
    FullPath:       C:\Program Files\Microsoft Office\Office12\EXCEL.EXE
    GUID:       {00020813-0000-0000-C000-000000000046}
    Type:       0
    Isbroken:       Falsch
    
    Description:    OLE Automation
    Name:       stdole
    Buitin:     Falsch
    Minor:      0
    Major:      2
    FullPath:       C:\Windows\system32\stdole2.tlb
    GUID:       {00020430-0000-0000-C000-000000000046}
    Type:       0
    Isbroken:       Falsch
    
    Description:    Microsoft Office 12.0 Object Library
    Name:       Office
    Buitin:     Falsch
    Minor:      4
    Major:      2
    FullPath:       C:\Program Files\Common Files\Microsoft Shared\OFFICE12\MSO.DLL
    GUID:       {2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}
    Type:       0
    Isbroken:       Falsch
    
    Description:    Microsoft HTML Object Library
    Name:       MSHTML
    Buitin:     Falsch
    Minor:      0
    Major:      4
    FullPath:       C:\Windows\system32\mshtml.tlb
    GUID:       {3050F1C5-98B5-11CF-BB82-00AA00BDCE0B}
    Type:       0
    Isbroken:       Falsch
    
    Description:    Microsoft XML, v6.0
    Name:       MSXML2
    Buitin:     Falsch
    Minor:      0
    Major:      6
    FullPath:       C:\Windows\System32\msxml6.dll
    GUID:       {F5078F18-C551-11D3-89B9-0000F81FE221}
    Type:       0
    Isbroken:       Falsch
    
    Description:    Microsoft Forms 2.0 Object Library
    Name:       MSForms
    Buitin:     Falsch
    Minor:      0
    Major:      2
    FullPath:       C:\Windows\system32\FM20.DLL
    GUID:       {0D452EE1-E08F-101A-852E-02608C4D0BB4}
    Type:       0
    Isbroken:       Falsch
    This infomation above can be useful for Later Early Binding.

    _.__________________

    Note that for Broken Libraries the GUID infomation appears to be available also, so I would tend to use .AddFromguid for Later Early Binding simply as I may heve a better chance of collecting before hand the GUID infomation than I do for other properties:
    MidTestJeffMoseToolsBroke.JPG : https://imgur.com/ZKq8BTr
    Attachment 1993

    MostPropertiesOfbrokenreferencesDontWork.JPG : https://imgur.com/FcVjDLl
    Attachment 1994
    In this example , the last two Library references were broken, but the GUID infomation is still available
    Attached Images Attached Images
    ….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!!

  6. #16
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,313
    Rep Power
    10

    Results for RaghavendraPrabhu

    Table of final results for solution to this Thread:
    http://www.excelfox.com/forum/showth...0548#post10548
    Using Excel 2007 32 bit
    S No
    Item
    Price
    Qty
    Total
    Date Distributed
    Task1
    Task2
    Task3
    Task4
    Date Tasks Completed
    Date Consolidated
    Comments
    Team Member
    1
    A1
    $ 25.00
    7
    $ 175.00
    17. Mrz 18
    Done N/A Done N/A
    17.Mrz 18
    22.Mrz 18
    Raghu
    2
    A5
    $ 95.00
    52
    $ 4,940.00
    17. Mrz 18
    Done N/A Done N/A
    17.Mrz 18
    22.Mrz 18
    Raghu
    3
    B1
    $ 985.00
    65
    $ 64,025.00
    17. Mrz 18
    Raghu
    4
    B5
    $ 85.00
    7
    $ 595.00
    18. Mrz 18
    Done N/A Done N/A
    18.Mrz 18
    22.Mrz 18
    Raghu
    5
    C1
    $ 41.00
    52
    $ 2,132.00
    18. Mrz 18
    N/A Done N/A Done
    18.Mrz 18
    22.Mrz 18
    Raghu
    6
    C5
    $ 655.00
    65
    $ 42,575.00
    20. Mrz 18
    Done N/A Done N/A
    20.Mrz 18
    22.Mrz 18
    Raghu
    7
    D1
    $ 1,258.00
    7
    $ 8,806.00
    20. Mrz 18
    N/A Done N/A Done
    20.Mrz 18
    22.Mrz 18
    Raghu
    8
    D5
    $ 44.00
    52
    $ 2,288.00
    22. Mrz 18
    Raghu
    9
    D10
    $ 55.00
    22
    $ 1,210.00
    22. Mrz 18
    N/A Done N/A Done
    22.Mrz 18
    22.Mrz 18
    Raghu
    10
    A3
    $ 22.00
    9
    $ 198.00
    17. Mrz 18
    Done N/A Done N/A
    17.Mrz 18
    Raju
    11
    A7
    $ 11.00
    12
    $ 132.00
    17. Mrz 18
    Raju
    12
    B3
    $ 223.00
    85
    $ 18,955.00
    17. Mrz 18
    N/A Done N/A Done
    17.Mrz 18
    Raju
    13
    B7
    $ 63.00
    9
    $ 567.00
    18. Mrz 18
    Done N/A Done N/A
    18.Mrz 18
    Raju
    14
    C3
    $ 96.00
    12
    $ 1,152.00
    18. Mrz 18
    N/A Done N/A Done
    18.Mrz 18
    Raju
    15
    C7
    $ 11.00
    85
    $ 935.00
    20. Mrz 18
    Done N/A Done N/A
    20.Mrz 18
    Raju
    16
    D3
    $ 332.00
    9
    $ 2,988.00
    20. Mrz 18
    N/A Done N/A Done
    20.Mrz 18
    Raju
    17
    D7
    $ 566.00
    12
    $ 6,792.00
    22. Mrz 18
    Done N/A Done N/A
    22.Mrz 18
    Raju
    18
    A4
    $ 45.00
    41
    $ 1,845.00
    17. Mrz 18
    Ramesh
    19
    A8
    $ 36.00
    32
    $ 1,152.00
    17. Mrz 18
    Done N/A Done N/A
    17.Mrz 18
    Ramesh
    20
    B4
    $ 41.00
    96
    $ 3,936.00
    17. Mrz 18
    N/A Done N/A Done
    17.Mrz 18
    Ramesh
    21
    B8
    $ 52.00
    41
    $ 2,132.00
    18. Mrz 18
    Done N/A Done N/A
    18.Mrz 18
    Ramesh
    22
    C4
    $ 85.00
    32
    $ 2,720.00
    18. Mrz 18
    N/A Done N/A Done
    18.Mrz 18
    Ramesh
    23
    C8
    $ 458.00
    96
    $ 43,968.00
    20. Mrz 18
    Done N/A Done N/A
    20.Mrz 18
    Ramesh
    24
    D4
    $ 22.00
    41
    $ 902.00
    20. Mrz 18
    N/A Done N/A Done
    20.Mrz 18
    Ramesh
    25
    D8
    $ 332.00
    32
    $ 10,624.00
    22. Mrz 18
    Done N/A Done N/A
    22.Mrz 18
    Ramesh
    26
    A2
    $ 35.00
    8
    $ 280.00
    17. Mrz 18
    Done N/A Done N/A
    17.Mrz 18
    Ravi
    27
    A6
    $ 78.00
    63
    $ 4,914.00
    17. Mrz 18
    Done N/A Done N/A
    17.Mrz 18
    Ravi
    28
    B2
    $ 11.00
    47
    $ 517.00
    17. Mrz 18
    N/A Done N/A Done
    17.Mrz 18
    Ravi
    29
    B6
    $ 96.00
    8
    $ 768.00
    18. Mrz 18
    Ravi
    30
    C2
    $ 74.00
    63
    $ 4,662.00
    18. Mrz 18
    Ravi
    31
    C6
    $ 365.00
    47
    $ 17,155.00
    20. Mrz 18
    Ravi
    32
    D2
    $ 33.00
    8
    $ 264.00
    20. Mrz 18
    N/A Done N/A Done
    20.Mrz 18
    Ravi
    33
    D6
    $ 55.00
    63
    $ 3,465.00
    22. Mrz 18
    Done N/A Done N/A
    22.Mrz 18
    Ravi
    34
    A9
    $ 12.00
    65
    $ 780.00
    22. Mrz 18
    Sangeeta
    35
    B9
    $ 45.00
    47
    $ 2,115.00
    22. Mrz 18
    Done N/A Done N/A
    21.Mrz 18
    Sangeeta
    36
    C9
    $ 56.00
    85
    $ 4,760.00
    22. Mrz 18
    N/A Done N/A Done
    21.Mrz 18
    Sangeeta
    37
    D9
    $ 89.00
    96
    $ 8,544.00
    22. Mrz 18
    Done N/A Done N/A
    21.Mrz 18
    Sangeeta
    38
    A10
    $ 25.00
    3
    $ 75.00
    22. Mrz 18
    N/A Done N/A Done
    21.Mrz 18
    Sangeeta
    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. #17
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,313
    Rep Power
    10

    Final Results for Code 2b) for Raghavendra

    Final Results for this Thread Post
    http://www.excelfox.com/forum/showth...0575#post10575

    S No
    Item
    Price
    Qty
    Total
    Date Distributed
    Task1
    Task2
    Task3
    Task4
    Date Tasks Completed
    Date Consolidated
    Comments
    Team Member
    1
    A1
    $ 25.00
    7
    $ 175.00
    17. Mrz 18
    Done N/A Done N/A
    17.Mrz 18
    24.Mrz 18
    Raghu
    2
    A5
    $ 95.00
    52
    $ 4,940.00
    17. Mrz 18
    Done N/A Done N/A
    17.Mrz 18
    24.Mrz 18
    Raghu
    3
    B1
    $ 985.00
    65
    $ 64,025.00
    17. Mrz 18
    Raghu
    4
    B5
    $ 85.00
    7
    $ 595.00
    18. Mrz 18
    Done N/A Done N/A
    18.Mrz 18
    24.Mrz 18
    Raghu
    5
    C1
    $ 41.00
    52
    $ 2,132.00
    18. Mrz 18
    N/A Done N/A Done
    18.Mrz 18
    24.Mrz 18
    Raghu
    6
    C5
    $ 655.00
    65
    $ 42,575.00
    20. Mrz 18
    Done N/A Done N/A
    20.Mrz 18
    24.Mrz 18
    Raghu
    7
    D1
    $ 1,258.00
    7
    $ 8,806.00
    20. Mrz 18
    N/A Done N/A Done
    20.Mrz 18
    24.Mrz 18
    Raghu
    8
    D5
    $ 44.00
    52
    $ 2,288.00
    22. Mrz 18
    Raghu
    9
    D10
    $ 55.00
    22
    $ 1,210.00
    22. Mrz 18
    N/A Done N/A Done
    22.Mrz 18
    24.Mrz 18
    Raghu
    10
    A3
    $ 22.00
    9
    $ 198.00
    17. Mrz 18
    Done N/A Done N/A
    17.Mrz 18
    24.Mrz 18
    Raju
    11
    A7
    $ 11.00
    12
    $ 132.00
    17. Mrz 18
    Raju
    12
    B3
    $ 223.00
    85
    $ 18,955.00
    17. Mrz 18
    N/A Done N/A Done
    17.Mrz 18
    24.Mrz 18
    Raju
    13
    B7
    $ 63.00
    9
    $ 567.00
    18. Mrz 18
    Done N/A Done N/A
    18.Mrz 18
    24.Mrz 18
    Raju
    14
    C3
    $ 96.00
    12
    $ 1,152.00
    18. Mrz 18
    N/A Done N/A Done
    18.Mrz 18
    24.Mrz 18
    Raju
    15
    C7
    $ 11.00
    85
    $ 935.00
    20. Mrz 18
    Done N/A Done N/A
    20.Mrz 18
    24.Mrz 18
    Raju
    16
    D3
    $ 332.00
    9
    $ 2,988.00
    20. Mrz 18
    N/A Done N/A Done
    20.Mrz 18
    24.Mrz 18
    Raju
    17
    D7
    $ 566.00
    12
    $ 6,792.00
    22. Mrz 18
    Done N/A Done N/A
    22.Mrz 18
    24.Mrz 18
    Raju
    18
    A4
    $ 45.00
    41
    $ 1,845.00
    17. Mrz 18
    Ramesh
    19
    A8
    $ 36.00
    32
    $ 1,152.00
    17. Mrz 18
    Done N/A Done N/A
    17.Mrz 18
    24.Mrz 18
    Ramesh
    20
    B4
    $ 41.00
    96
    $ 3,936.00
    17. Mrz 18
    N/A Done N/A Done
    17.Mrz 18
    24.Mrz 18
    Ramesh
    21
    B8
    $ 52.00
    41
    $ 2,132.00
    18. Mrz 18
    Done N/A Done N/A
    18.Mrz 18
    24.Mrz 18
    Ramesh
    22
    C4
    $ 85.00
    32
    $ 2,720.00
    18. Mrz 18
    N/A Done N/A Done
    18.Mrz 18
    24.Mrz 18
    Ramesh
    23
    C8
    $ 458.00
    96
    $ 43,968.00
    20. Mrz 18
    Done N/A Done N/A
    20.Mrz 18
    24.Mrz 18
    Ramesh
    24
    D4
    $ 22.00
    41
    $ 902.00
    20. Mrz 18
    N/A Done N/A Done
    20.Mrz 18
    24.Mrz 18
    Ramesh
    25
    D8
    $ 332.00
    32
    $ 10,624.00
    22. Mrz 18
    Done N/A Done N/A
    22.Mrz 18
    24.Mrz 18
    Ramesh
    26
    A2
    $ 35.00
    8
    $ 280.00
    17. Mrz 18
    Done N/A Done N/A
    17.Mrz 18
    24.Mrz 18
    Ravi
    27
    A6
    $ 78.00
    63
    $ 4,914.00
    17. Mrz 18
    Done N/A Done N/A
    17.Mrz 18
    24.Mrz 18
    Ravi
    28
    B2
    $ 11.00
    47
    $ 517.00
    17. Mrz 18
    N/A Done N/A Done
    17.Mrz 18
    24.Mrz 18
    Ravi
    29
    B6
    $ 96.00
    8
    $ 768.00
    18. Mrz 18
    Ravi
    30
    C2
    $ 74.00
    63
    $ 4,662.00
    18. Mrz 18
    Ravi
    31
    C6
    $ 365.00
    47
    $ 17,155.00
    20. Mrz 18
    Ravi
    32
    D2
    $ 33.00
    8
    $ 264.00
    20. Mrz 18
    N/A Done N/A Done
    20.Mrz 18
    24.Mrz 18
    Ravi
    33
    D6
    $ 55.00
    63
    $ 3,465.00
    22. Mrz 18
    Done N/A Done N/A
    22.Mrz 18
    24.Mrz 18
    Ravi
    34
    A9
    $ 12.00
    65
    $ 780.00
    22. Mrz 18
    Sangeeta
    35
    B9
    $ 45.00
    47
    $ 2,115.00
    22. Mrz 18
    Done N/A Done N/A
    21.Mrz 18
    24.Mrz 18
    Sangeeta
    36
    C9
    $ 56.00
    85
    $ 4,760.00
    22. Mrz 18
    N/A Done N/A Done
    21.Mrz 18
    24.Mrz 18
    Sangeeta
    37
    D9
    $ 89.00
    96
    $ 8,544.00
    22. Mrz 18
    Done N/A Done N/A
    21.Mrz 18
    24.Mrz 18
    Sangeeta
    38
    A10
    $ 25.00
    3
    $ 75.00
    22. Mrz 18
    N/A Done N/A Done
    21.Mrz 18
    24.Mrz 18
    Sangeeta
    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!!

  8. #18
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,313
    Rep Power
    10
    Code for last post
    Code:
    Sub Raghavendra2b() 'http://www.excelfox.com/forum/showthread.php/2238-Copy-data-from-Unique-files-into-Masterfile-all-the-files-in-the-same-folder?p=10575#post10575
    Dim LisWb As Workbook
     Set LisWb = ThisWorkbook
    Dim Ws2 As Worksheet, Ws1 As Worksheet
     Set Ws2 = LisWb.Worksheets.Item(2): Set Ws1 = LisWb.Worksheets.Item(1):
    Dim strWb As String: Let strWb = Dir(ThisWorkbook.Path & "\" & "*" & ".xlsx", vbNormal)
       Do '    Loop  through all .xlsx Files in same Folder as this workbook
        Workbooks.Open Filename:=ThisWorkbook.Path & Application.PathSeparator & strWb
        Let Ws2.Range("A2:A1000").Value = "=" & "'" & ThisWorkbook.Path & "\[" & strWb & "]Sheet1'!$A2"
       Dim Lr As Long
        Let Lr = Ws2.Range("A2:A1000").Find(what:=0, after:=Ws2.Range("A2"), LookIn:=xlValues, lookat:=xlWhole, searchorder:=xlByRows, searchdirection:=xlNext).Row - 1
        Let Ws1.Range("G" & Ws2.Range("A2").Value + 1 & ":L" & Ws2.Range("A" & Lr & "").Value + 1 & "").Value = "=" & "'" & ThisWorkbook.Path & "\[" & strWb & "]Sheet1'!G2"
        Let Ws1.Range("G" & Ws2.Range("A2").Value + 1 & ":L" & Ws2.Range("A" & Lr & "").Value + 1 & "").Value = Ws1.Evaluate("=IF(ISERR(" & Ws1.Range("G" & Ws2.Range("A2").Value + 1 & ":L" & Ws2.Range("A" & Lr & "").Value + 1 & "").Address & ")," & """""" & ",IF(" & Ws1.Range("G" & Ws2.Range("A2").Value + 1 & ":L" & Ws2.Range("A" & Lr & "").Value + 1 & "").Address & "=0," & """""" & "," & Ws1.Range("G" & Ws2.Range("A2").Value + 1 & ":L" & Ws2.Range("A" & Lr & "").Value + 1 & "").Address & "))")
        'Let Ws1.Range("G" & Ws2.Range("A2").Value + 1 & ":L" & Ws2.Range("A" & Lr & "").Value + 1 & "").Value = Evaluate("=IF(ISERR(" & Ws1.Range("G" & Ws2.Range("A2").Value + 1 & ":L" & Ws2.Range("A" & Lr & "").Value + 1 & "").Address & ")," & Empty & ",IF(" & Ws1.Range("G" & Ws2.Range("A2").Value + 1 & ":L" & Ws2.Range("A" & Lr & "").Value + 1 & "").Address & "=0," & Empty & "," & Ws1.Range("G" & Ws2.Range("A2").Value + 1 & ":L" & Ws2.Range("A" & Lr & "").Value + 1 & "").Address & "))") ' Does not remove the 0s ??
        Let Ws1.Range("K" & Ws2.Range("A2").Value + 1 & ":L" & Ws2.Range("A" & Lr & "").Value + 1 & "").NumberFormat = "d.mmm yy"
        Let Ws1.Range("K" & Ws2.Range("A2").Value + 1 & ":K" & Ws2.Range("A" & Lr & "").Value + 1 & "").SpecialCells(xlCellTypeConstants, xlNumbers).Offset(, 1).Value = Format(Date, "dd mmm yyyy") ' Put current date in cells 1 column to the left of cells in K column that have dates in
        Let Workbooks("" & strWb & "").Worksheets.Item(1).Range("L2:L" & Lr & "").Value = Ws1.Range("L" & Ws2.Range("A2").Value + 1 & ":L" & Ws2.Range("A" & Lr & "").Value + 1 & "").Value ' Date values  pasted in in last code line are given to correspondin cells in current open data workbook, first worksheet
        Let Workbooks("" & strWb & "").Worksheets.Item(1).Range("L2:L" & Lr & "").NumberFormat = "d.mmm yy"
        Workbooks("" & strWb & "").Close SaveChanges:=True
        Let strWb = Dir
       Loop While strWb <> ""
    End Sub
    ….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. #19
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,313
    Rep Power
    10

    Search for text in txt File using VBA, display rows where text found

    Code in support of these Threads:
    http://www.excelfox.com/forum/showth...0582#post10582


    What code does in General:
    This code will search for specific text in a text file
    What code does in Specifically:
    The code assumes that you have a simple text file looking something like this:
    TextRowsInTextFile.jpg : https://imgur.com/upBY709
    Attachment 2031
    HotFixID
    {EF8CD7FC-438D-49E3-A2C7-201052D9F2EF}
    {8D2CDFAB-0079-43CC-A289-2F7A67F0A4DE}
    {98D8F490-1F42-4F29-A59B-BF96D23A11BA}
    {B730F010-3FCF-4E80-8A5A-C1DBEC0CF55A}
    {B73E5AF4-40C6-4EA9-8F57-CFA70CC72BD6}
    {BF11577A-6876-45AA-86C9-2BA4CFB8B019}
    {E359D786-B101-4545-B8AB-8652323CF3CA}
    {F4139440-5426-4C6F-909B-F71CEB1071B1}
    {B2FAD7E1-67F9-435D-98BD-A77DBF4E1381}


    Here is the example text file used in this explanation and currently hard coded into the code : “UpdatesOnVistaAspire4810TZG25thMarch.txt” : https://app.box.com/s/z90o8yj7iz0188yci34mu7gahe2tfhce

    You can input , when prompted, a text string or text strings to look for. For more than one text string you should separate them by at least one space, like
    __ B23 ___6872 35689
    ( The code below has those actual strings hard coded as the default search values )
    Input Box Functioning.jpg : https://imgur.com/o9wlnhK https://imgur.com/JtnTDmy
    Attachment 2030 Attachment 2034

    The code will look for those text strings in all text file lines except the first.
    ( there is also a section to check the content of the first line, but it is 'commented out in the code below )
    The code searches for those lines which contain any of those strings. In this demo example, one thing that I would be looking for is the rows in the text file containing B23 in them, so that would be the middle few in this screenshot .. B23 TextRowsInTextFile.JPG : https://imgur.com/JHRqJJc
    Attachment 2032

    The final result of the codes is to give you a string message which has a list of the text strings that you were looking for, and a list of the full text in any rows which contained that. The string is displayed in a message box. In addition if you are in the VB Editor Window and hit Ctrl+g , the you will see the results also in the immediate window. This latter has the advantage that you can copy the data to the clipboard by highlighting it and hitting Ctrl+c , ( or alternatively select the text and select the option to copy available via right mouse click ) : YouLookedForFindedWas.JPG: https://imgur.com/tyW4HSJ
    Attachment 2033

    Here is the code. It should be pasted into any File which is in the same Folder as the text file you want to search through. Currently the code is hard coded to search the file with name
    “UpdatesOnVistaAspire4810TZG25thMarch.txt”
    So you will need to change that to suit your text file name.


    Code:
    Sub CheqUpDates() 
    On Error GoTo GetLaid ' Instruction to replace / modify VBA default error handler by hanging on to the arousal this code starting from the labelled  label code area
    Rem 1)  ActiviaExcretionLink, AEL. Checking Object link mechanismus
    '1a) Exposing of interfaces for active RunableTimed data axctivated link
    Dim ActiviEL As String       '       "Pointer" to a "Blue Print" (or Form, Questionnaire not yet filled in, a template etc.)"Pigeon Hole" in Memory, sufficient in construction to house a piece of Paper with code text giving the relevant information for the particular Variable Type. VBA is sent to it when it passes it. In a Routine it may be given a particular “Value”, or (“Values” for Objects). There instructions say then how to do that and handle(store) that(those). At Dim the created Paper is like a Blue Print that has some empty spaces not yet filled in. A String is a bit tricky. The Blue Print code line Paper in the Pigeon Hole will allow to note the string Length and an Initial start memory Location. This Location well have to change frequently as strings of different length are assigned. Instructions will tell how to do this. Theoretically a special value vbNullString is set to aid in quick checks.. But..http://www.mrexcel.com/forum/excel-questions/361246-vbnullstring-2.html#post44116
     Let ActiviEL = ThisWorkbook.Path & "\UpdatesOnVistaAspire4810TZG25thMarch.txt" 'Will be referrenced in code through an opened "route" to it
                                                         Dim LedgerFreiNummer As String: Let LedgerFreiNummer = "1" & "00" ' Not required in this code : https://www.excelforum.com/excel-general/1225401-value-of-true-1-or-1-vba-vs-worksheet.html
    Dim AEL_Highway As Long: Let AEL_Highway = FreeFile("" & LedgerFreiNummer & "") ' Obtain from 2nd building phase (256-511) Ledger of available Highways, coercidentally to value 1_255 likely , bits of my 1 & 00
    Rem 2) text file info
    '    '2a) Open File read first line check the sht - want Head
    '     Open ActiviEL For Input As AEL_Highway '
    '    Dim ShtHead As String
    '     Line Input #AEL_Highway, ShtHead ' Check substancialating for getting good Head
    '        If InStr(1, ShtHead, "HotFix", vbTextCompare) = 0 Then
    '         MsgBox prompt:="Got no HotFix IDin " & ShtHead
    '         Exit Sub
    '        Else
    '         Debug.Print ShtHead
    '        End If
    '     Close AEL_Highway ' Datei scheißen
    '2b) "row" count in text file
    Dim RecardRows As Long '           '_-' Long is very simple to handle, - final memory "size" type is known (123.456 and 000.001 have same "size" computer memory ) , and so a Address suggestion can be given for the next line when the variable is filled in.  '( Long is a Big whole Number limit (-2,147,483,648 to 2,147,483,647) If you need some sort of validation the value should only be within the range of a Byte/Integer otherwise there's no point using anything but Long.--upon/after 32-bit, Integers (Short) need converted internally anyways, so a Long is actually faster. )       https://www.mrexcel.com/forum/excel-questions/803662-byte-backward-loop-4.html
     Let RecardRows = 0
    Dim strLine As String
     Open ActiviEL For Input As AEL_Highway '    Activated embedded Link  objectimocom  Binary as to referencingmocomed aka AliAs AEL_Highway opened of now
        Do Until EOF(AEL_Highway) 'Looping all lines in text file ' Solange bis Datei-Ende - EOF(AEL_Highway) will be set to true by the last a carriage liney mo not found a next line in Line Input #AEL_Highway, strLine
         Line Input #AEL_Highway, strLine:       Let RecardRows = RecardRows + 1    '   Inputed der liney mo a carriage returned after then record register count of it to that increase by the one done liney mo
        Loop 'Do Until EOF(AEL_Highway) 'Looping all lines in text file
    'Let RecardRows = RecardRows + 1 'would need to do this if I did not closeat '2a) and reopen in '2b)
     Close AEL_Highway ' Datei scheißen - scheise drauf der Highway geschnmut - no longer activamoed AEL not activia mated mo
    Rem 3) Prepare output Array for all text File data
    Dim arrOut() As String: ReDim arrOut(1 To RecardRows) ' can declare to known size and type. We cannot use Dim arrOut(1 to RecardRows) as pre complie compile cannot do the RecardRows is not available: method ReDim is Runtime
    Rem 4) Main loop for filling in Output Data =============================================
     Open ActiviEL For Input As AEL_Highway
    Dim RecardRow As Long ', strLine As String
        For RecardRow = 1 To RecardRows '(Do Until EOF(AEL_Highway) 'Looping all lines in text file)
         Line Input #AEL_Highway, strLine: Let arrOut(RecardRow) = strLine   ' Zeile lesen - as before but this time place in element of output array
        Next RecardRow ' ===== (Do Until EOF(AEL_Highway) 'Looping all lines in text file)===
     Close AEL_Highway ' Datei schließen
    
    Rem 5) search for specific strings
    '5a) Bring in text or texts to be searched for, reduce multiple spaces to single spaces between if more than one given and, and split into array of those individual text strings      https://powerspreadsheets.com/excel-vba-inputbox/     http://www.excelfox.com/forum/showthread.php/2227-VBA-Input-Pop-up-Boxes-Application-InputBox-Method-versus-VBA-InputBox-Function?p=10462#post10462
    Dim strSrch As String '
     Let strSrch = VBA.InputBox(prompt:="Type in all or part of text or texts to be searched for" & vbCrLf & "Seperate texts by at least one space", Title:="Input text to be searched for in text File lines", Default:="KB23   6872   35689", xpos:=100, ypos:=100)
     Let strSrch = Evaluate("=TRIM(SUBSTITUTE(" & """" & strSrch & """" & ",CHAR(32)," & """" & " " & """" & "))") ' TRIM function trims the 7-bit ASCII space character (value 32). In the Unicode character set, there is an additional space character called the nonbreaking space character that has a decimal value of 160. This character is commonly used in Web pages as the HTML entity,  . By itself, the TRIM function does not remove this nonbreaking space character.       https://www.excelforum.com/excel-formulas-and-functions/1217202-is-there-a-function-similar-to-trim-but-that-only-removes-trailing-spaces-2.html
     Dim SrchTxts() As String ' VBA strings function split to be used to get individual text into elements of an Array. The split function returns an array of string type elements
     Let SrchTxts() = VBA.Split(strSrch, " ", -1, vbTextCompare) ' Split the (   strSrch    ,    using space as delimiter    ,   for unrestricted count     ,  using text compare which is case insensitive  )
        For RecardRow = 2 To RecardRows 'At each record row
        Dim Txtie As Long ' in default example this is  0   1   2
            For Txtie = 0 To UBound(SrchTxts()) ' VBA Split retuns a 1 dimension array  starting at  indicie 0   For example we have indicies of  0  1  2   givig three elements in total of  KB23   6872   35689
            Dim strFnded As String
                If InStr(1, arrOut(RecardRow), SrchTxts(Txtie), vbTextCompare) > 0 Then Let strFnded = strFnded & vbCrLf & arrOut(RecardRow)        '   The returned postion along from the left  ( starting from fist character  ,  in the current row   ,  looking for current text string   ,  compare text which is case insensitive    )  This will return 0 if not found and if found the postione along from the left in the row string where the search string part starts.  So an found position will do for a find
            Next Txtie
        Next RecardRow
     
    Rem 6) Display  search results
      Let strSrch = Replace(strSrch, " ", vbCrLf, 1, -1, vbBinaryCompare) 'replace in (   strSrch   ,   space   ,    with carriage return ,   start at and return from first character   ,   no resriction  on count    ,    compare of exact computer memory so effectively  case sensitive which is probably faster )      for convinent string list in output later
      MsgBox prompt:="You looked for" & vbCrLf & strSrch & vbCrLf & vbCrLf & "Finded was" & strFnded
      Debug.Print "You looked for" & vbCrLf & strSrch & vbCrLf & vbCrLf & "Finded was" & strFnded
    Exit Sub ' Normal code ending
    GetLaid: ' "Error handling code section       http://www.excelfox.com/forum/showthread.php/2239-Resume-On-Error-GoTo-0-1-GoTo-Error-Handling-Statements-Runtime-VBA-Error-Handling-ORNeRe-GoRoT-N0Nula-1
     MsgBox (Err.Description)
     Close AEL_Highway ' Datei scheißen
    End Sub

    Some typical results in next post
    Attached Images Attached Images
    ….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!!

  10. #20
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,313
    Rep Power
    10
    Using this File:
    “UpdatesOnVistaAspire4810TZG25thMarch.txt” : https://app.box.com/s/z90o8yj7iz0188yci34mu7gahe2tfhce
    That file is downloaded into the same Folder as the file containing the code from the last Post.
    This code line needs to have that text file reference in it such:
    Let ActiviEL = ThisWorkbook.Path & "\UpdatesOnVistaAspire4810TZG25thMarch.txt"
    Run code entering these search values when prompted
    2553154 2726958 2965291 2920813 3054873 974554

    Here the output string

    You looked for
    2553154
    2726958
    2965291
    2920813
    3054873
    974554

    Finded was


    _.______________________________________________


    Using this File:
    “UpdatesAcerMartinWin7Pro64Bit26thMarch.txt” : https://app.box.com/s/8m96l0e7yh1wcb15y06eaaz6a7vtjzgd
    That file is downloaded into the same Folder as the file containing the code from the last Post.
    This code line needs to have that text file reference in it such:
    Let ActiviEL = ThisWorkbook.Path & "\“UpdatesAcerMartinWin7Pro64Bit26thMarch.txt"
    Run code entering these search values when prompted
    2553154 2726958 2965291 2920813 3054873 974554

    Here the output string

    You looked for
    2553154
    2726958
    2965291
    2920813
    3054873
    974554

    Finded was
    ….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. Table Tests. And Thread Copy Tests No Reply needed
    By DocAElstein in forum Test Area
    Replies: 1
    Last Post: 11-20-2018, 01:11 PM
  2. Table Tests. And Thread Copy Tests No Reply needed
    By DocAElstein in forum Test Area
    Replies: 1
    Last Post: 11-20-2018, 01:11 PM
  3. Replies: 11
    Last Post: 10-13-2013, 10:53 PM
  4. Replies: 1
    Last Post: 09-14-2013, 12:49 PM
  5. Replies: 7
    Last Post: 08-28-2013, 12:57 AM

Posting Permissions

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