Here you go. The msgbox commands are for debugging purposes only to see what is being reported. The creation of the CopyRangeArray() entries is actually done elsewhere in the code but i reproduced it below. The array is being correctly filled so that is not the problem.:
Dim CopyRangeArray() As String
MaxLoopIterations = WorksheetFunction.CountIf(Sheet3.Columns(1), "yes")
ReDim CopyRangeArray(1 To MaxLoopIterations)
For Counter = 1 To MaxLoopIterations
'...misc code
Set FoundCell = Sheet3.Columns(1).Find(what:="yes", After:=FoundCell, LookIn:=xlValues, lookat:=xlPart, searchorder:=xlByRows, searchdirection:=xlNext, MatchCase:=False)
CopyRangeArray(Counter) = Cells(FoundCell.Row, PrimKeyPosition).Address & ":" & _
Cells(FoundCell.Row + Sheet1.Range("extract_value").Value - 1, LastColumn).Address
'...misc code
next counter
Below is the output of the array and they correctly identify the correct ranges that need to be copied:
$F$2:$L$13
$F$47:$L$58
$F$300:$L$311
$F$505:$L$516
$F$550:$L$561
$F$803:$L$814
$F$1008:$L$1019
$F$1053:$L$1064
$F$1306:$L$1317
The problem starts here. The following code is used to copy ranges that meet certain criteria. those ranges are created in CopyRangeArray() from above.
For Counter = 1 To MaxLoopIterations
MsgBox "before stuff.."
Worksheets(NewWSName).Cells(CopyRangeArray(Counter)).Value = Sheet3(CopyRangeArray(Counter)).Value
MsgBox "Right = " '& Sheet3(CopyRangeArray(Counter)).Value
MsgBox "addresses = " & CopyRangeArray(Counter)
MsgBox "Left = " '& Worksheets(NewWSName).Cells(CopyRangeArray(Counter)).Value
Next Counter
msgbox "done"
The puzzling thing is that the ONLY msgbox that appear are the ones for "before stuff...", "done" and "address". The remaining two msgbox do not even appear. That is strange. They don't even show up! Wierd. If i comment out the part after & then the msgbox will appear. I don't know why this is happening.
Hope this helps and thanks for your reply.