Created
April 11, 2013 14:54
-
-
Save hashrock/5364045 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Sub CommandButton1_Click() | |
Dim i As Long | |
Dim outFile As String | |
Dim hashSheet As Worksheet | |
hashSheet = ActiveSheet | |
Workbooks.Open Filename:=ThisWorkbook.Path & "\template.xls" | |
For i = 1 To ActiveSheet.UsedRange.Rows.Count | |
Dim key As String | |
Dim val As String | |
key = Cells(1, i).Value | |
val = Cells(2, i).Value | |
Cells.Replace What:=key, Replacement:=val, LookAt:=xlPart | |
Next i | |
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & outFile | |
ActiveWorkbook.Close | |
Debug.Print Cells(1, i).Value & " - " & Cells(2, i).Value | |
' For Each r In ActiveSheet.UsedRange.Rows | |
' Debug.Print "---" | |
' For Each c In r.Columns | |
' Debug.Print c.Value | |
' Next | |
' Next | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment