Thanks watersev
I hacked my way through it and came up with the following...
Sub LastRowAndColumn()
Dim S1LC As Long
Dim S1LR As Long
Dim S2LC As Long
Dim S2LR As Long
Dim SheetCreated As Boolean
Sheets("Input").Select
S1LC = Sheets("Input").Cells(3, Columns.Count).End(xlToLeft).Column
S1LR = Sheets("Input").Cells(Rows.Count, 3).End(xlUp).Row
Sheets("Template").Select
S2LC = Sheets("Template").Cells(1, Columns.Count).End(xlToLeft).Column
S2LR = Sheets("Template").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Input").Select
Dim S1RowLength As Long
S1RowLength = S1LR - 3
ReDim S1SValue(1 To S1RowLength)
x = 4
For i = 1 To S1RowLength
S1SValue(i) = Sheets("Input").Cells(x, 2)
x = x + 1
Next i
Dim S1ColumnLength As Long
S1ColumnLength = S1LC - 2
ReDim S1RValue(1 To S1RowLength)
y = 3
x = 4
SheetCreated = False
For ii = 1 To S1ColumnLength
For i = 1 To S1RowLength
S1RValue(i) = Sheets("Input").Cells(x, y)
x = x + 1
If SheetCreated = False Then
Application.ScreenUpdating = False
Sheets("Template").Copy After:=Sheets("Template")
SheetCreated = True
ActiveSheet.Name = "TempSheet"
End If
Sheets("TempSheet").Select
Columns(1).Select
Selection.Replace What:=S1SValue(i), Replacement:=S1RValue(i), LookAt:=xlPart, _
SearchOrder:=xlByColumns, MatchCase:=False
Sheets("Input").Select
Next i
y = y + 1
x = 4
SheetCreated = False
Open S1RValue(1) & ".txt" For Output As #1
Sheets("TempSheet").Select
For S2NR = 1 To S2LR
ExpData = Selection.Cells(S2NR, 1).Value
Print #1, ExpData
Next S2NR
Application.DisplayAlerts = False
Sheets("TempSheet").Delete
Sheets("Input").Select
Close #1
Application.DisplayAlerts = True
Sheets("Input").Select
Next ii
MsgBox "Configs Generated"
End Sub
Yours is way cleaner... Thanks again.
Bookmarks