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
Code:' 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://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgyG714V_k7odQMrTz14AaABAg.9h740K6COOA9iHOYYpaA bC
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgxuL6YCUckeUIh9hoh4AaABAg
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgwGTEyefOX7msIh1wZ4AaABAg.9h4sd6Vs4qE9h7G-bVm8_-
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=Ugw3nF0C04AGt73H1BB4AaABAg.9h6VhNCM-DZ9h7EqbG23kg
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgwGTEyefOX7msIh1wZ4AaABAg.9h4sd6Vs4qE9h7KvJXmK 8o
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=Ugw3nF0C04AGt73H1BB4AaABAg.9h6VhNCM-DZ9h7E1gwg4Aq
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgywFtBEpkHDuK55r214AaABAg
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgwviLabd7r_3KpP6wh4AaABAg.9h5lFRmix1R9h79hNGvJ bu
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgwviLabd7r_3KpP6wh4AaABAg.9h5lFRmix1R9h79YAfa2 4T
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgwviLabd7r_3KpP6wh4AaABAg.9h5lFRmix1R9h79M1SYH 1E
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgwviLabd7r_3KpP6wh4AaABAg.9h5lFRmix1R9h78SxhXT nR
https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA




Reply With Quote
Bookmarks