Object Required Error

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,564
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Rich (BB code):
Sub Initiate()
    Dim qdate As Date
    Set wb_master = ThisWorkbook
    Set ws_destination = wb_master.Worksheets("Destination")
    mbevents = False
        With ws_destination
            .Range("E1") = Format(Date + 1, "ddd mmm-dd-yy")
        'booking data
        Call process_bkgs
        With ws_destination
            lrow_bkgrows = ws_bookings.Cells(ws_bookings.Rows.Count, "B").End(xlUp).Row
            cnt_bkgrows = lrow_bkgrows - 1
            qdate = .Range("E1").Value
            cnt_date = Application.WorksheetFunction.CountIf(ws_bookings.Columns(2), qdate)
        End With
    mbevents = True
End Sub

I am receiving an "Object required." error with the line above in red. I'm unsure why. Thoughts?[/code]
 
Last edited:

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
You don't have an End With for the first With stement
VBA Code:
With ws_destination
            .Range("E1") = Format(Date + 1, "ddd mmm-dd-yy")
 
Upvote 0
E1 is text, hence the error, try it like
VBA Code:
            .Range("E1") = Date + 1
            .Range("E1").NumberFormat = "ddd mmm-dd-yy"
 
Upvote 0
Solution
Thank you all for pointing out my errors! Much appreciation!
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,025
Messages
6,122,732
Members
449,093
Latest member
Mnur

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