Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need this to loop

Status
Not open for further replies.

wafs

Technical User
Jan 17, 2006
112
US
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
 
Got it to loop. Thanks for all the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top