+ Reply to Thread
Results 1 to 4 of 4

sheets reference does not work

  1. #1
    Registered User
    Join Date
    04-30-2009
    Location
    tokyo
    MS-Off Ver
    Excel 2016
    Posts
    38

    sheets reference does not work

    Hello,

    Lately the reference to sheets does not work. In the code below the debug.print line gives me an error. Any ideas?

    Thank you

    Please Login or Register  to view this content.
    Last edited by katto01; 12-31-2019 at 09:39 AM.

  2. #2
    Forum Guru Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2010 on Linux
    Posts
    11,891

    Re: sheets reference does not work

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    8,863

    Re: sheets reference does not work

    Your code works for me...
    What issues are you having...What error...

    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere.....
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember......Mark Thread as Solved.
    Excel Forum Rocks!!!

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    5,365

    Arrow

    Hi,

    as sheet references always work if only the Logic is respected !
    Here this error occurs when the active workbook is not the workbook containing the code

    Just better qualifying the workbook before the Sheets statement alone
    as alone that means the active workbook
    so not the workbook containing the code (aka ThisWorkbook) where exists the worksheet refered by its Sheet2 codename
    Last edited by Marc L; 12-31-2019 at 12:59 PM. Reason: typo

+ 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-25-2016, 11:19 AM
  2. populate a list on one work sheet from multiple work sheets that meet a criteria
    By Kelly Linton-Selkirk in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-21-2015, 03:56 PM
  3. Create PDF files from multiple work sheets in a single work book
    By erprasannaa in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-29-2012, 03:42 AM
  4. Macro to collate data from different work books and different work sheets
    By bvdileep in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-04-2012, 05:34 AM
  5. Extract data into a master work book by accessing various input work sheets/workbooks
    By kammariarun in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-08-2011, 05:10 PM
  6. Reference Other Work Sheets for Conditional Formatting
    By j92devils in forum Excel General
    Replies: 3
    Last Post: 05-29-2009, 11:06 AM
  7. Copy rows from work sheets to combine to one work sheet based on cell value
    By joemcmillen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-11-2008, 05:04 PM

Tags for this Thread

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