Results 1 to 10 of 10

Open .TXT file Replace Specific Lines with Cell Values

Threaded View

  1. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Open .TXT file Replace Specific Lines with Cell Values

    Sub snb()
     sn=sheets("Sheet1").cells(5,1).currentregion
     
     for j=1 to ubound(sn)
      Open sn(j,1) For Input As #1
       sp = Split(Input(LOF(1), 1), vbcrfl)
      Close
        
      sp(8) = "whatever it has to be changed into"
      sp(9) = "I"
    
      Open sn(j,1) For Output As #1
       Print #1, Join(sp, vbCrLf)
      Close
     Next
    End Sub
    Last edited by snb; 11-08-2011 at 01:28 PM.



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1