Object required error

Boston_Paul

New Member
Joined
Sep 3, 2024
Messages
2
Office Version
  1. 2019
Platform
  1. Windows
In the following "sub", I keep getting an "object Required" error when the "with Range" code begins.

I have read other solutions, but no matter what I do, I get the same error. Any assistance would be appreciated.

Rich (BB code):
Sub addmonthtotalrowcolors()

 Dim rloop As Long
 
 Windows("email tracking report.xlsm").Activate
 Worksheets("RPC Prom Output").Activate
 Worksheets("rpc prom output").Select
 
 Last_Row = Cells(Rows.Count, 1).End(xlUp).Row
 
 Range("A2").Select
 
  For rloop = 2 To Last_Row
    If Cells(rloop, 2) = "JAN" Then
      With Range(Cells(rloop, 1), Cells(rloop, 7)).Select _
        .Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        .ThemeColor = xlThemeColorDark1
        .TintAndShade = -0.14996795556505
        .PatternTintAndShade = 0
      End With
    End If
  Next rloop

End Sub
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Welcome to the forum. :)

Remove the .Select _ part from the end of the first red line
 
Upvote 0
Solution

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top