I have code tha will copy all excel workbook sheets in a folder into a single workbook. Then it looks at the Affs tab for the ticket number. It will find match the ticket number from the Affs tab to the ticket number in any tab with name "aviswkly" . Every ticket in the Affs tab will have a match. It then copies the "aviswkly" data followed by Affs tab data into the combinedsheet tab. It does the copy and paste fine but then gets hung up. The following code has issue that I can't figure out. It just hangs like it might be looping through all rows. I've attached the code and workbooks. Appreciate any advice on this.
Dim t As Range, cs As Worksheet, zs As Worksheet, ss As Worksheet, tmatch As Range, cs_last_row As Long
Set fs = Worksheets("affs")
Set cs = Worksheets("Combinedsheet")
For Each t In fs.Columns(9).Cells
If t.Value = "Ticket Number" Then
If t.Value = "" Then Exit For
For Each zs In Wb1.Sheets ' was: ThisWorkbook.Sheets
If Left(zs.Name, 9) = "aviswkly_" Then
' If Left(zs.Name, 9) = "aviswkly_" Then this is original line changing tab name
Set tmatch = zs.Columns(9).Find(What:=t.Value)
If Not tmatch Is Nothing Then
cs_last_row = cs.UsedRange.SpecialCells(xlCellTypeLastCell).Row + 1
cs.Range("A" & cs_last_row & ":Q" & cs_last_row).Value = zs.Range("A" & tmatch.Row & ":Q" & tmatch.Row).Value
cs.Range("R" & cs_last_row & ":AQ" & cs_last_row).Value = fs.Range("A" & t.Row & ":Z" & t.Row).Value
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
-Mike Kapnisakis, Warner Bros
With your subscription - you'll gain access to our exclusive IT community of thousands of IT pros. You'll also be able to connect with highly specified Experts to get personalized solutions to your troubleshooting & research questions. It’s like crowd-sourced consulting.
We can't always guarantee that the perfect solution to your specific problem will be waiting for you. If you ask your own question - our Certified Experts will team up with you to help you get the answers you need.
Our certified Experts are CTOs, CISOs, and Technical Architects who answer questions, write articles, and produce videos on Experts Exchange. 99% of them have full time tech jobs - they volunteer their time to help other people in the technology industry learn and succeed.
We can't guarantee quick solutions - Experts Exchange isn't a help desk. We're a community of IT professionals committed to sharing knowledge. Our experts volunteer their time to help other people in the technology industry learn and succeed.