+ Reply to Thread
Results 1 to 14 of 14

"Object doesn't support this property or method" -Help with VBA

  1. #1
    Registered User
    Join Date
    06-26-2015
    Location
    Winnipeg
    MS-Off Ver
    Office 365
    Posts
    17

    "Object doesn't support this property or method" -Help with VBA

    What I am trying to accomplish w/ this snippet of code is to find the right hand side of the table in my worksheet and clear the contents of the columns to the right of the table. I have marked where my error is cause in the code. If there is an easier way to do this it would be welcome.
    Please Login or Register  to view this content.
    Thanks in advance,

  2. #2
    Valued Forum Contributor
    Join Date
    02-06-2014
    Location
    N/A
    MS-Off Ver
    N/A
    Posts
    373

    Re: "Object doesn't support this property or method" -Help with VBA

    Could you please upload a sample workbook

  3. #3
    Registered User
    Join Date
    06-26-2015
    Location
    Winnipeg
    MS-Off Ver
    Office 365
    Posts
    17

    Re: "Object doesn't support this property or method" -Help with VBA

    In the attached file that is what I am left with after the reconciliation. I need to clean up...i.e delete what remains to the right of the table.
    Attached Files Attached Files

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: "Object doesn't support this property or method" -Help with VBA

    Change Columns to ListColumns.
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    06-26-2015
    Location
    Winnipeg
    MS-Off Ver
    Office 365
    Posts
    17

    Re: "Object doesn't support this property or method" -Help with VBA

    That worked. I no longer get an error, but it's not achieving the desired result. Any suggestions?

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: "Object doesn't support this property or method" -Help with VBA

    What is the desired result?

    In the example file are you trying to clear columns O and P?

  7. #7
    Registered User
    Join Date
    06-26-2015
    Location
    Winnipeg
    MS-Off Ver
    Office 365
    Posts
    17

    Re: "Object doesn't support this property or method" -Help with VBA

    The desired result is to clear columns to the right of the table. The data to be cleared will not always be in those two columns so it needs to be a dynamic reference.

  8. #8
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: "Object doesn't support this property or method" -Help with VBA

    That's a one liner:

    Option Explicit
    Please Login or Register  to view this content.

    If that's too hard to read, you can add a couple of variables and go piece-by-piece.


    Please Login or Register  to view this content.

    Your first error, was using .columns.count (instead of .ListColumns.count).
    Last edited by GeneralDisarray; 07-28-2015 at 04:00 PM.
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  9. #9
    Valued Forum Contributor
    Join Date
    02-06-2014
    Location
    N/A
    MS-Off Ver
    N/A
    Posts
    373

    Re: "Object doesn't support this property or method" -Help with VBA

    Try this...

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    06-26-2015
    Location
    Winnipeg
    MS-Off Ver
    Office 365
    Posts
    17

    Re: "Object doesn't support this property or method" -Help with VBA

    GeneralDisarray - Worked like a charm, thank you very much!

  11. #11
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: "Object doesn't support this property or method" -Help with VBA

    No problem, I added another version for clarity (just unpacked that one line into multiple steps).

    Please mark your thread as solved :D

  12. #12
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: "Object doesn't support this property or method" -Help with VBA

    Another...
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  13. #13
    Registered User
    Join Date
    06-26-2015
    Location
    Winnipeg
    MS-Off Ver
    Office 365
    Posts
    17

    Re: "Object doesn't support this property or method" -Help with VBA

    GeneralDisarray - If I may ask, what is the difference between columns.count and listColumns.count?

  14. #14
    Valued Forum Contributor
    Join Date
    02-06-2014
    Location
    N/A
    MS-Off Ver
    N/A
    Posts
    373

    Re: "Object doesn't support this property or method" -Help with VBA

    Quote Originally Posted by bdueck View Post
    GeneralDisarray - If I may ask, what is the difference between columns.count and listColumns.count?
    ListColumns is a valid object of ListObject, Columns is not.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. runtime error 438 "object doesn't support this property or method"
    By lazyengineer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-06-2015, 01:47 PM
  2. "Run time error 438, Object doesn't support this property or method."
    By dobracik in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-12-2015, 09:56 AM
  3. VBA "object doesn't support this property or method" error
    By mfortier3 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-08-2014, 09:37 PM
  4. [SOLVED] Experiencing "Run Time Error 438: 'Object doesn't support this property or method'"
    By BYizz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-29-2013, 05:44 PM
  5. Replies: 12
    Last Post: 11-25-2012, 02:33 PM
  6. "Object doesn't support this property or method" No idea what is wrong
    By jtakaine in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-18-2012, 02:21 PM
  7. [SOLVED] Help "438 - Object doesn't support this property or method"
    By Jonthurston7 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-01-2011, 06:13 AM

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