The following code was working fine in a 2007 application, but I have a user who needs it to work with 2003. I'd like one file that can handle the conversion. Everything is working fine right now except the portion bolded and underlined. It won't paste to the "Risk" sheet as previously.
Code:
'NAICS Sector Enter button
Private Sub CommandButton2_Click()
Dim Found As Range, FirstFound As String, AllRows As Range
Dim keysheet As Worksheet
Set keysheet = ThisWorkbook.Sheets("system")
If ComboBox1.Value <> vbNullString Then
Set Found = keysheet.Range("C:C").Find(ComboBox1.Value, LookIn:=xlValues, Lookat:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=fasle)
If Found Is Nothing Then
MsgBox "No match found.", vbCritical, "No Match"
Else
FirstFound = Found.Address
Set AllRows = Found.EntireRow
Do
Set Found = keysheet.Range("C:C").FindNext(Found)
Set AllRows = Union(AllRows, Found.EntireRow)
Loop Until Found.Address = FirstFound
AllRows.Copy
[B][U] Sheets("Risk").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial
[/U][/B] Range("A2").Select
End If
End If
End Sub