I'm not sure how to colour the line but the "LastNumba" line of code is causing me some grief. I've tried to replicate the Rownumba format but I can't quite get it right. Can anyone help me work out how to find the last cell with a value in it using the row found in row number, and then allow me to use it as ColRef so I can paste a value into the result?
Dim RowNumba As Long, LastNumba As Long
Dim CellRef As Range, ColRef as Range
Dim S2LI As Worksheet
Set S2LI = ThisWorkbook.Sheets(2) ' Set the worksheet, Change to suit
' Change the (2) below to the column number your searching (2 = B:B)
RowNumba = S2LI.Columns(2).Find(What:=SearchString, LookIn:=xlValues, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Row
LastNumba = S2LI.Cells(rownumber, Columns.count).End(xlToLeft)
' Change the column number to suit
Set ColRef = S2LI.Cells(RowNumba, LastNumba)
Set CellRef = S2LI.Cells(RowNumba, 86)
If Letters.Browse.Text <> "" And Letters.Description.Text <> "Templates" And CellRef.Value = "" Then
On Error Resume Next
CellRef.Value = Letters.Browse.Value
CellRef.Offset(0, 1).Value = Letters.Description.Value
On Error GoTo 0
ElseIf Letters.Browse.Text <> "Templates" And Letters.Description.Text <> "" And CellRef.Value <> "" Then
On Error Resume Next
ColRef.Offset(0, 1).Value = Letters.Browse.Value
ColRef.Offset(0, 2).Value = Letters.Description.Value
On Error GoTo 0
Bookmarks