I have this going through a source sheet once, but I need it to loop through. I have to have output(7) look at every output(1) before it makes a loop. What am I missing to get the code to do this.
output(7) = "CA" + r 'dest sheet part numbers
output(8) = sheets(destsh).Range(output(7)).Text
output(1) = "A" + r 'part numbers
output(2) = sheets(notes).Range(output(1)).Value
TestRange8 = output(2)
output(5) = "C" + r 'comments
output(6) = sheets(notes).Range(output(5)).Text
TestRange7 = output(6)
For x = 1 To 4000
If UCase(Trim(sheets(destsh).Range(output(7)))) = UCase(Trim(sheets(notes).Range(output(1)).Value)) And UCase(Trim(sheets(notes).Range(output(5)).Text)) <> "" Then
c = c + 1
y = c + 103 'Tells where to start importing comments
reportlocation = "A" + y 'Starting row of comments
sheets(notes).Range(output(1)).Copy sheets(destsh).Range(reportlocation)
reportlocation = "B" + y 'comments
sheets(notes).Range(output(5)).Copy sheets(destsh).Range(reportlocation)
r = r + 1
output(5) = "C" + r 'Testrange7
output(1) = "A" + r 'TestRange8
Else
r = r + 1
output(5) = "C" + r
output(1) = "A" + r
End If
Next
output(7) = "CA" + r
output(7) = "CA" + r 'dest sheet part numbers
output(8) = sheets(destsh).Range(output(7)).Text
output(1) = "A" + r 'part numbers
output(2) = sheets(notes).Range(output(1)).Value
TestRange8 = output(2)
output(5) = "C" + r 'comments
output(6) = sheets(notes).Range(output(5)).Text
TestRange7 = output(6)
For x = 1 To 4000
If UCase(Trim(sheets(destsh).Range(output(7)))) = UCase(Trim(sheets(notes).Range(output(1)).Value)) And UCase(Trim(sheets(notes).Range(output(5)).Text)) <> "" Then
c = c + 1
y = c + 103 'Tells where to start importing comments
reportlocation = "A" + y 'Starting row of comments
sheets(notes).Range(output(1)).Copy sheets(destsh).Range(reportlocation)
reportlocation = "B" + y 'comments
sheets(notes).Range(output(5)).Copy sheets(destsh).Range(reportlocation)
r = r + 1
output(5) = "C" + r 'Testrange7
output(1) = "A" + r 'TestRange8
Else
r = r + 1
output(5) = "C" + r
output(1) = "A" + r
End If
Next
output(7) = "CA" + r