+ Reply to Thread
Results 1 to 7 of 7

Removing borders and fill VBA

  1. #1
    Registered User
    Join Date
    09-16-2008
    Location
    Jersey
    Posts
    57

    Removing borders and fill VBA

    Hi

    I am trying to remove all borders and fills from all cells within a workbook (all sheets) but it seems everything is giving me error "400" today.
    this is the code, could some one tell me where i am going wrong?

    Please Login or Register  to view this content.


    Many thanks
    Jsantos
    Last edited by jsantos; 10-21-2012 at 04:24 PM.

  2. #2
    Forum Contributor
    Join Date
    10-02-2012
    Location
    Bumi Nusantara
    MS-Off Ver
    Excel 2010; Excel 2016
    Posts
    136

    Re: Removing borders and fill VBA

    i copied your code into vba module and its works in my pc

    did you write in worksheet or workbook? if yes, move that code into vba module
    click the star if it solves your problem

  3. #3
    Registered User
    Join Date
    09-16-2008
    Location
    Jersey
    Posts
    57

    Re: Removing borders and fill VBA

    Thanks dwint

    changed it into a module but now it shows a different error
    "Run-Time error '1004'
    Unable to set the LIneStyle property of the borders class

    I am moving it to a new workbook now but dont think will make any dufference

    Any more sugestions?

    Thanks
    Jsantos

  4. #4
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    883

    Re: Removing borders and fill VBA

    Are the borders/fill put in manually or by conditional formatting?
    If my solution worked (or not) please let me know. If your question is answered then please remember to mark it solved

    Computers are like air conditioners. They work fine until you start opening windows. ~Author Unknown

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Removing borders and fill VBA

    To me it indicates your file is protected!
    Last edited by jeffreybrown; 10-21-2012 at 03:29 PM.
    HTH
    Regards, Jeff

  6. #6
    Registered User
    Join Date
    09-16-2008
    Location
    Jersey
    Posts
    57

    Re: Removing borders and fill VBA

    Cheers guys
    All sorted now, thanks jeffreybrown i unprottected the one sheet protected and MAGIC no more errors, the macros worked smoothly.


    Many thanks
    Jsantos

  7. #7
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Removing borders and fill VBA

    Glad you got it working for your needs. Thanks for the feedback

+ 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