Hi All,
I am trying to use the below to find and replace a set day (Day 11) with another day I. It does not cause an eror but it also does not replace anything. It runs as part of the loop, which works fine as it goes through and changes the date no problem. I think my error is in how I am referencing I in the replace code line. Can you please have a look and help me if possible? Thank you for your help with this.
Code
For I = 1 To lD 'Run loop to generate and name pages from template.
issuedate = (I & "/" & Mo & "/" & "2013")
finaldate = Format(issuedate, "dd\/MM\/yyyy")
Range("C2").Value = finaldate
Columns("A:M").Select
Selection.Replace What:="Day 11", Replacement:=("Day" & I), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveSheet.Cells(1, 1).Select
On Error Resume Next
Sheets(ActiveSheet.Index + 1).Activate
If Err.Number <> 0 Then Sheets(1).Activate
Next
Display More