This is the second part of the coding from the last post
This should be copied and pasted directly under the coding from the last post
https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHACode:' Case " " ' Let WotchaGot = WotchaGot & """" & " " & """" & " & " ' Case " " ' Let WotchaGot = WotchaGot & """" & " " & """" & " & " ' Case " " ' Let WotchaGot = WotchaGot & """" & " " & """" & " & " ' Case " " ' Let WotchaGot = WotchaGot & """" & " " & """" & " & " ' Case " " ' Let WotchaGot = WotchaGot & """" & " " & """" & " & " ' Case " " ' Let WotchaGot = WotchaGot & """" & " " & """" & " & " ' Case " " ' Let WotchaGot = WotchaGot & """" & " " & """" & " & " ' Case " " ' Let WotchaGot = WotchaGot & """" & " " & """" & " & " ' Case " " ' Let WotchaGot = WotchaGot & """" & " " & """" & " & " ' ' 2a)(ii)_2 ' Case " " ' Let WotchaGot = WotchaGot & """" & " " & """" & " & " ' Case " " ' Let WotchaGot = WotchaGot & """" & " " & """" & " & " Case vbCr Let WotchaGot = WotchaGot & "vbCr & " ' I actuall would write manually in this case like vbCr & Case vbLf Let WotchaGot = WotchaGot & "vbLf & " Case vbCrLf Let WotchaGot = WotchaGot & "vbCrLf & " Case """" ' This is how to get a single " No one is quite sure how this works. My theory that, is as good as any other, is that syntaxly """" or " """ or """ " are accepted. But in that the """ bit is somewhat strange for VBA. It seems to match the first and Third " together as a valid pair but the other " in the middle of the 3 "s is also syntax OK, and does not error as """ would because of the final 4th " which it syntaxly sees as a valid pair matched simultaneously as it does some similar check on the first and Third as a concluding string pair. All is well except that the second " is captured within a accepted enclosing pair made up of the first and third " At the same time the 4th " is accepted as a final concluding " paired with the second which it is using but at the same time now isolated from. Let WotchaGot = WotchaGot & """" & """" & """" & """" & " & " ' The reason why "" "" would not work is that at the end of the "" the next empty character signalises the end of a string pair, and only if it saw a " would it keep checking the syntax rules which then lead in the previous case to the situation described above. Case vbTab Let WotchaGot = WotchaGot & "vbTab & " ' 2a)(iii) Case Else WotchaGot = WotchaGot & "Chr(" & Asc(Caracter) & ")" & " & " 'Let CaseElse = Caracter End Select End If ' End of the "normal simple character" or not ' -------2a)------Ended----------- '2b) A 2 column Array for convenience of a list Let arrWotchaGot(Cnt + 1, 1) = Cnt & " " & Caracter: Let arrWotchaGot(Cnt + 1, 2) = Asc(Caracter) ' +1 for header Next Cnt ' ========Main Loop================================================================================= If WotchaGot <> "" Then Let WotchaGot = Left(WotchaGot, Len(WotchaGot) - 3) ' take off last " & " ( 2 spaces one either side of a & ) Rem 3 Output '3a) String MsgBox prompt:=WotchaGot: Debug.Print WotchaGot ' Hit Ctrl+g from the VB Editor to get a copyable version of the entire string '3b) List Dim NxtClm As Long: Let NxtClm = 1 ' In conjunction with next If this prevents the first column beine taken as 0 for an empty worksheet If Not ws.Range("A1").Value = "" Then Let NxtClm = ws.Cells.Item(1, Columns.Count).End(xlToLeft).Column + 1 Let ws.Cells.Item(1, NxtClm).Resize(UBound(arrWotchaGot(), 1), UBound(arrWotchaGot(), 2)).Value = arrWotchaGot() End Sub '
https://eileenslounge.com/viewtopic.php?p=317218#p317218
https://eileenslounge.com/viewtopic.php?p=316955#p316955
https://eileenslounge.com/viewtopic.php?p=316955#p316955
https://eileenslounge.com/viewtopic.php?p=316940#p316940
https://eileenslounge.com/viewtopic.php?p=316927#p316927
https://eileenslounge.com/viewtopic.php?p=317014#p317014
https://eileenslounge.com/viewtopic.php?p=317006#p317006
https://eileenslounge.com/viewtopic.php?p=316935#p316935
https://eileenslounge.com/viewtopic.php?p=316875#p316875
https://eileenslounge.com/viewtopic.php?p=316254#p316254
https://eileenslounge.com/viewtopic.php?p=316280#p316280
https://eileenslounge.com/viewtopic.php?p=315915#p315915
https://eileenslounge.com/viewtopic.php?p=315512#p315512
https://eileenslounge.com/viewtopic.php?p=315744#p315744
https://www.eileenslounge.com/viewtopic.php?p=315512#p315512
https://eileenslounge.com/viewtopic.php?p=315680#p315680
https://eileenslounge.com/viewtopic.php?p=315743#p315743
https://www.eileenslounge.com/viewtopic.php?p=315326#p315326
https://www.eileenslounge.com/viewtopic.php?f=30&t=40752
https://eileenslounge.com/viewtopic.php?p=314950#p314950
https://www.eileenslounge.com/viewtopic.php?p=314940#p314940
https://www.eileenslounge.com/viewtopic.php?p=314926#p314926
https://www.eileenslounge.com/viewtopic.php?p=314920#p314920
https://www.eileenslounge.com/viewtopic.php?f=30&t=40533&p=314837#p314837
https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA




Reply With Quote
Bookmarks