+ Reply to Thread
Results 1 to 11 of 11

Active Range Class Error

  1. #1
    Banned User!
    Join Date
    10-12-2018
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    358

    Active Range Class Error

    Hi when running code to protect workbook I get a message which says "Please revise the entry in A1. It appears to contain one or more illegal characters."

    Then it goes to debug but a different sheet each time.

    Does anyone know why this is happening?

    Thank you

    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,638

    Re: Active Range Class Error

    That routine will fire every time you select a different worksheet. It's your message that is being displayed and presumably it means it doesn't like whatever is in cell A1 on one or more of those sheets.

    Difficult to be definitive without seeing the workbook.


    Edited to reflect cell A1 rather than cell A31 (my mistake)
    Last edited by TMS; 10-29-2018 at 02:33 PM. Reason: Change A31 reference to A1
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Banned User!
    Join Date
    10-12-2018
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    358

    Re: Active Range Class Error

    Can you take a look please?

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Active Range Class Error

    Good afternoon xjohnson

    Want to share the password with us? Not impossible to do it without, but it makes life easier.

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  5. #5
    Banned User!
    Join Date
    10-12-2018
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    358

    Re: Active Range Class Error

    Sorry it's "password"

  6. #6
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Active Range Class Error

    Hi xjohnson

    The code for the protect module works OK on its own. In running it fires the "Worksheet_SelectionChange" module which forces an error which shows the error code.

    Get rid of this module and it seems to work OK.

    What is the purpose of this module? I can see what it's trying to do, but not why it's there.

    HTH

    DominicB

  7. #7
    Banned User!
    Join Date
    10-12-2018
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    358

    Re: Active Range Class Error

    I have been developing over time I think it's to name the sheet tabs from cell A1

  8. #8
    Banned User!
    Join Date
    10-12-2018
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    358

    Re: Active Range Class Error

    Yes it is to name the sheets which I still want the ability to do so.

    Can it be modified or perhaps another way to name the sheets from the 'Vehicle Information'! sheet?

  9. #9
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Active Range Class Error

    Hi xjohnson

    If you don't know what it's for, do you actually need it? Why does a tab need renaming every time a user selects the sheet?

    For now, comment out all the code in that module and see how things run without it. If you remember why it absolutely had to be included, then post back with more details about what it needs to do and why it needs to do it and some of us will help out with suggestions.

    HTH

    DominicB

  10. #10
    Banned User!
    Join Date
    10-12-2018
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    358

    Re: Active Range Class Error

    I found another workbook that I was using for this:

    Please Login or Register  to view this content.
    It works fine now sorry for the trouble guys.

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,638

    Re: Active Range Class Error

    You're welcome. Thanks for the rep.


    The difference is that the last code module sits behind a specific worksheet and, when a change is made to cell A1, it will update the sheet name.

    The code module in the OP sits behind the workbook and fires every time a sheet is selected ... and changes the sheet name based on cell A1 (my mistake in my original response)

+ 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. Replies: 1
    Last Post: 08-08-2016, 04:35 PM
  2. Runtime error '1004': Paste special method of range class error.
    By Daryl Zer0 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-05-2014, 01:44 AM
  3. Replies: 1
    Last Post: 01-07-2014, 01:08 AM
  4. Replies: 4
    Last Post: 11-15-2013, 05:03 PM
  5. VBA Code...error = run time error 1004 autofilter method of range class failed
    By Dariusd7 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-15-2013, 04:49 PM
  6. [SOLVED] VBA Error: Runtime Error 1004: AutoFilter method of Range class failed
    By jl22stac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2013, 07:27 PM
  7. Runtime Error 1004 "Active method of range class failed".
    By new2excel2012 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-14-2012, 07:55 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