dpaton05
Well-known Member
- Joined
- Aug 14, 2018
- Messages
- 2,392
- Office Version
- 365
- 2016
- Platform
- Windows
I am getting an overflow error message and I don't know why. Here is the code:
I have underlined the line that is highlighted. Can someone help me please?
Code:
Sub AddReference()
Dim wb1 As Workbook, wb2 As Workbook
Dim sh1 As Worksheet, sh2 As Worksheet, sh3 As Worksheet
Dim f As Range, client As Variant, Ref As String, ref2 As Integer
Set wb1 = ThisWorkbook
Set sh1 = wb1.Sheets("npss_quote_sheet")
Set wb2 = Workbooks("client_list.xlsm")
Set sh3 = wb2.Sheets("Reference")
Ref = sh3.Cells(Rows.Count, 1).End(xlUp).Value
[U] ref2 = Ref + 1[/U]
sh3.Cells(1, 1).End(xlDown).Offset(1, 0).Value = ref2
sh1.Range("H5").Value = ref2
End Sub
I have underlined the line that is highlighted. Can someone help me please?