|
Lidt opdatering. Jeg er kommet lidt videre, bla. grundet en design ændring. Følgende løkke virker, men ikke efter hensigten. Jeg vil gerne have den til at gentage en løkke 12 gange, og den ene løkke vil jeg gerne have gentaget x gange, men hele tiden på et ny område. Og data hver gang en 12'er løkke startes skal $f$1 tælle 1 op. Sub ChangeRowData() Dim i As Variant Dim j As Variant Sheets("SCRIPTFILE").Select Range("A1").Select ' For i = 1 To Sheets("count").Range("AB4").Value
For j = 1 To 12 ActiveCell.Replace What:="$F$1", Replacement:="$F$1", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False Cells.FindNext(After:=ActiveCell).Activate Next j
For j = 1 To 12 ActiveCell.Replace What:="$F$1", Replacement:="$F$2", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False Cells.FindNext(After:=ActiveCell).Activate Next j For j = 1 To 12 ActiveCell.Replace What:="$F$1", Replacement:="$F$3", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False Cells.FindNext(After:=ActiveCell).Activate Next j For j = 1 To 12 ActiveCell.Replace What:="$F$1", Replacement:="$F$4", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False Cells.FindNext(After:=ActiveCell).Activate Next j 'osv op til i End Sub
|