• Ask a Question
150
Insert Image Size must be less than < 5MB.
    Ask a Question
    Cancel
    150
    More answer You can create 5 answer(s).
      Ask a Poll
      Cancel
      Top Contributor

      Multiple Text files using Loop in VB

      I need help in generating multiple text files i.e. loop function in the following VB, can someone help  in modifying this.
      Private Sub CommandButton2_Click()
      Dim iCntr

      Dim strFile_Path As String
      strFile_Path = “C:\Users\Desktop\Assignee” & Format(Now(), “dd-MMM-yyyy h-m-s”) & “.txt”
      Open strFile_Path For Output As #1
      For iCntr = 2 To 4620

      Print #1, Sheets(“ImportTemplate2016”).Range(“D” & iCntr)

      Next iCntr
      Close #1

      End Sub

       

      Asked by pranab79in on January 23, 2017 in VBA: Programming.
      0 Answers