+ Reply to Thread
Results 1 to 11 of 11

Compile error: Object required

Hybrid View

  1. #1
    Registered User
    Join Date
    04-18-2007
    Posts
    2
    Yes, that seems to be the problem. I removed all 'Set' and was more explicit about the types. It's very confusing that

    Dim A, B As Integer
    does not declare two integers... since it is not, it should not even be allowed input.

    But hey, it's just Microsoft, so who cares?

    Thanks,

    Hinnerk

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628
    If you write:
    Dim A, B As Integer
    Excel assumes 'A' as Variant and 'B' as Integer.

    You can also write so in one row:
    Dim A as Integer, B As Integer
    Regards,
    Antonio

  3. #3
    Registered User
    Join Date
    05-10-2012
    Location
    houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Compile error: Object required

    Hello,
    i saw you post and i am having a simular problem but iam not sure if it is the same fix can you help me out please.
    i am using the set for iLastRow(IE: getting the last row count in order to auto fill based off that value)


    My code keeps crashing on the Set iLastRow....etc...

    Sub MCR_Data_shtData_Format()
    ' MCR_Data_shtData_Format Macro
    ' Formats the Data sheet
    Dim iLastRow As Long
    
    'turns off/on screen actions
    Application.ScreenUpdating = Fasle
    
     With shtComp
    Set iLastRow = shtComp.Cells(Rows.Count, "D").End(xlUp).Row
    End With
    Please help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1