Results 1 to 10 of 380

Thread: Appendix Thread. ( Codes for other Threads, etc.) Event Coding Drpdown Data validation

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,521
    Rep Power
    10
    In support of this Post
    https://excelfox.com/forum/showthrea...ll=1#post13246



    Run the macro below, Sub XXXXXSeperatedValuesTextFiles() ,
    It will make text files in the same folder as the folder in which the macro is run in.
    ( The macro is also in the shared File, XXXXXSeperatedValues.xlsm )
    XXXXSeperatedValuesTextFiles.JPG : https://imgur.com/A2IebLK

    The text files are shown in the last post https://excelfox.com/forum/showthrea...ll=1#post13247

    Code:
    Option Explicit
    Sub XXXXXSeperatedValuesTextFiles()     '                      https://excelfox.com/forum/showthread.php/2467-COPY-AND-PASTE?p=13246#post13246
     Call Make____SeperatedValuesTextFiles("CommaSeperatedValues", ",")                        ' make  CSV files ( Comma Seperated Values Files )
     Call Make____SeperatedValuesTextFiles("TabSeperatedValues", vbTab)                        ' make  Tab Seperated Values Files
     Call Make____SeperatedValuesTextFiles("NMODSeperatedValues", "NMOD")                      ' make  NMOD Seperated Values Files
     Call Make____SeperatedValuesTextFiles("SemiColonSeperatedValues", ";")                    ' make  ; Seperated Values Files ( sometimes called german Comma seperated files )
     Call Make____SeperatedValuesTextFiles("GollyWobblesSeperatedValues", "GollyWobbles")      ' make  GollyWobbles Seperated Values Files
     Call Make____SeperatedValuesTextFiles("PipeSeperatedValues", "|")                     ' make  Pipe Seperated Values Files
    End Sub
    
    Sub Make____SeperatedValuesTextFiles(ByVal Filname As String, Seprator As String)
    ' Make long string for text file
    Dim strTotalFile As String
     Let strTotalFile = MakeA____SeperatedValuesTextFile(Seprator)
    ' .txt  Text File
    Dim Highway1 As Long: Let Highway1 = FreeFile(0) 'range 1 – 255, inclusive - next free
     Open ThisWorkbook.Path & "\" & Filname & ".txt" For Append As #Highway1 ' Will be made if not there
     Print #Highway1, strTotalFile
     Close #Highway1
    
    ' .csv  Text File
    Dim Highway2 As Long: Let Highway2 = FreeFile(0) 'range 1 – 255, inclusive - next free
     Open ThisWorkbook.Path & "\" & Filname & ".csv" For Append As #Highway2 ' Will be made if not there
     Print #Highway2, strTotalFile
     Close #Highway2
    
    End Sub
    Function MakeA____SeperatedValuesTextFile(ByVal Seprator As String) As String
    Rem 1 Rows
    Dim AvinashNamesRow1() As Variant, AvinashNamesRow2() As Variant
     Let AvinashNamesRow1() = Array("zyxw123", "jhas", "", "rider", "roger", "anjus", "sumanjjj")
     Let AvinashNamesRow2() = Array("Leonardo", "umpsbug", "kinjals", "", "tinamishra", "kinjal124", "fxe632")
    Rem 2 make single string for text files
    Dim strOut As String
     Let strOut = Join(AvinashNamesRow1(), Seprator) & vbCr & vbLf & Join(AvinashNamesRow2(), Seprator) & vbCr & vbLf
     Let MakeA____SeperatedValuesTextFile = strOut
    End Function




    Ref
    https://excelfox.com/forum/showthrea...-a-range/page3




    XXXXXSeperatedValues.xlsm : https://app.box.com/s/jvlu048tkg0rjw7xi4c4r838abw1z7bi

  2. #2
    Sir Moderator sandy666's Avatar
    Join Date
    May 2018
    Posts
    240
    Rep Power
    8
    Quote Originally Posted by DocAElstein View Post
    ADHahdhdh
    do ya have : Attention deficit hyperactivity disorder (ADHD) ???
    sandy
    I know you know but I forgot my Crystal Ball and don't know what you know also I may not remember what I did weeks, months or years ago so answer asap. Thinking doesn't hurt

  3. #3
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,521
    Rep Power
    10
    Quote Originally Posted by sandy666 View Post
    do ya have : Attention deficit hyperactivity disorder (ADHD) ???
    Probably
    it is fixer's fault - he is driving me mad!

Similar Threads

  1. Replies: 189
    Last Post: 02-06-2025, 02:53 PM
  2. Replies: 293
    Last Post: 09-24-2020, 01:53 AM
  3. Appendix Thread. Diet Protokol Coding Adaptions
    By DocAElstein in forum Test Area
    Replies: 6
    Last Post: 09-05-2019, 10:45 AM
  4. Restrict data within the Cell (Data Validation)
    By dritan0478 in forum Excel Help
    Replies: 1
    Last Post: 07-27-2017, 09:03 PM

Posting Permissions

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