I have a sheet with job numbers in column A, columns B to F contain extra details for the job number and in the same row as the job number, except for column C which has a number of entries in multiple rows. Each entry can have up to 8 rows in column C. I need to be able to extract the data from row C for the job number and stop at the row before the next job number. The data is extracted to textboxes (SignCode?) on a userform. The code I am using almost does this but it always extracts 8 rows of data. I am sure I have missed something simple but I keep going round in circles and getting nowhere. Hope this makes sense. Any assistance would be appreciated.
VBA Code:
'Find the Job Number and extract data to userform
r = WorksheetFunction.Match(Val(JobNumber), ws1.Columns(1), 0)
currentrow = r
Me.Address = ws1.Cells(r, "B")
Me.RcdDate = ws1.Cells(r, "D")
Me.DateComp = ws1.Cells(r, "E")
Me.Installer = ws1.Cells(r, "F")
Me.SignCode1 = ws1.Cells(r, "C")
Me.SignCode2 = ws1.Cells(r + 1, "C")
Me.SignCode3 = ws1.Cells(r + 2, "C")
Me.SignCode4 = ws1.Cells(r + 3, "C")
Me.SignCode5 = ws1.Cells(r + 4, "C")
Me.SignCode6 = ws1.Cells(r + 5, "C")
Me.SignCode7 = ws1.Cells(r + 6, "C")
Me.SignCode8 = ws1.Cells(r + 7, "C")