Hello shrimic ,
The problem is with how you are using the Find method. Find returns a Range object if the search was successful. If not then it returns the special object Nothing. You should always check the result of the Find before you attempt to get the address, row or column.
Try this corrected version of your macro...
Option Explicit
Sub DRSummary()
Dim PartRngWorkbook1DRAMSheeta As Range, PartRngWorkbook1DRAMSheetb As Range
Dim cs As Variant, Cell1 As Long, Cell2 As Long, rngMultiply As Range, Cell4 As Long, Cell5 As Long
Dim Cell6 As Long, PartRngWorkbook1Reference1 As Range, a As Variant, wsActive As Worksheet, intCols As Integer, rngValue As Range
Dim Found As Range
Const intMultiplier As Integer = 10080
Dim ab As Worksheet, lastRow As Long
Set PartRngWorkbook1DRAMSheeta = Worksheets("DRAM").Range("A3", Worksheets("DRAM").Range("A65536").End(xlUp))
Set PartRngWorkbook1DRAMSheetb = Worksheets("DRAM").Range("B", Worksheets("DRAM").Range("B65536").End(xlUp))
Set PartRngWorkbook1Reference1 = Worksheets("Refer").Range("A", Worksheets("Refer").Range("A65536").End(xlUp))
Set ab = Worksheets("DRAM")
For Each cs In PartRngWorkbook1DRAMSheeta
If IsNumeric(Application.Match(cs.Value, PartRngWorkbook1Reference1, 0)) Then
Found = PartRngWorkbook1DRAMSheeta.Find(cs.Value)
If Found Is Nothing Then GoTo NextCell Else Cell1 = Found.Row
Found = PartRngWorkbook1DRAMSheetb.Find("WS Group Totals:", Range("B", Cell1))
If Found Is Nothing Then GoTo NextCell Else Cell2 = Found.Row
With ab
intCols = .Cells(Cell2, .Columns.Count).End(xlToLeft).Column
lastRow = .Rows(.Rows.Count).Row
Set rngMultiply = .Range(.Cells(Cell2, 4), .Cells(Cell2, intCols))
For Each rngValue In rngMultiply
.Cells(.Rows.Count, rngValue.Column).End(xlUp).Offset(2, 0).Value = intMultiplier * rngValue.Value
Next
End With
End If
NextCell:
Next cs
End Sub
Bookmarks