Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is it possible to use something like this example for find replace except just for single sheet with a huge data set, say 300,000 - 600,000 cells?
The built in find replace is quite slow. This looks like it loads the sheet (actually a file) into a Variable and does the find replace on the variable... is that correct? Howard Sub TextFile_FindReplace() 'PURPOSE: Modify Contents of a text file using Find/Replace 'SOURCE: www.TheSpreadsheetGuru.com Dim TextFile As Integer Dim FilePath As String Dim FileContent As String 'File Path of Text File FilePath = "C:\Users\chris\Desktop\MyFile.txt" 'Determine the next file number available for use by the FileOpen function TextFile = FreeFile 'Open the text file in a Read State Open FilePath For Input As TextFile 'Store file content inside a variable FileContent = Input(LOF(TextFile), TextFile) 'Clost Text File Close TextFile 'Find/Replace FileContent = Replace(FileContent, "Hello", "Good By") 'Determine the next file number available for use by the FileOpen function TextFile = FreeFile 'Open the text file in a Write State Open FilePath For Output As TextFile 'Write New Text data to file ' Print #TextFile, FileContent 'Close Text File Close TextFile End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
find and replace data | Excel Worksheet Functions | |||
Find/Replace Event or Find/Replace for Protected Sheet ... | Excel Programming | |||
find and replace - replace data in rows to separated by commas | Excel Worksheet Functions | |||
Replace method - cannot find any data to replace | Excel Programming | |||
Find and Replace Data from one into another | Excel Programming |