I am having an issue running a VBA script that has worked in the past. The code is attempting to take data from a database and an Excel sheet already generated, then run more calculations to create usable statistics. This portion is where the error comes in:
Dim strCat, strPlan, strCustodian As String
Dim i, lAssets As Long
Dim cn As ADODB.Connection, rs As ADODB.Recordset 'ms access connection
Public Const cnnstr As String = "Provider=Microsoft.ACE.OLEDB.12.0; " & _
"Data Source=G:\OADBO.accdb;"
Dim rngA, rngB As Range
Option Explicit
Private Sub MapExisting()
Set rngA = wsEntry.Range("A1")
For i = 1 To WorksheetFunction.CountIf(wsEntry.Columns(1), "*") - 1
Set rngB = wsMapping.Range("B1")
Set rngA = wsEntry.Columns(1).Find(What:="*", After:=rngA, _
LookIn:=xlValues, LookAt:=xlWhole, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False)
strCat = rngA.Offset(0, 2).Value
lAssets = rngA.Offset(0, 1).Value
Call UnprotectSheets
Set rngB = wsMapping.Columns(2).Find(What:=strCat, After:=rngB, _
LookIn:=xlFormulas, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False)
rngB.End(xlUp).Offset(1, 0).Value = rngA * <——ERROR IS HERE *
rngB.End(xlUp).Offset(0, 3).Value = lAssets
Jump:
Next i
'finds all empty rows and keeps as range- then hides all in range
'Call Hiderows
Call ProtectSheets
Application.ScreenUpdating = True
wsMapping.Activate
End Sub