+ Reply to Thread
Results 1 to 2 of 2

My macro runs on hidden sheets

  1. #1
    Registered User
    Join Date
    02-09-2015
    Location
    Paris
    MS-Off Ver
    Office 2013
    Posts
    5

    My macro runs on hidden sheets

    Hi!

    I am super-beginner in the macro world. We have a macro that reads certain columns and rows in all sheets of different excel files, and then writes them in a new excel file. My problem is that it even considers the hidden sheets and I don't know why. This creates me problems to organize information in pivot tables. Could you help me?

    I = 1
    For Each objFile In objFolder.Files
    Workbooks.Open (objFile)

    For csht = 1 To ActiveWorkbook.Sheets.Count 'worksheet or sheets
    With ActiveSheet
    lastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
    End With
    For teller = 11 To lastRow
    'print no of worksheets
    Cells(I + 1, 3) = ActiveWorkbook.Worksheets.Count
    'print sheetname
    Cells(I + 1, 4) = Sheets(csht).Name
    Range(Cells(I + 1, 5), Cells(I + 1, 25)) = Sheets(Sheets(csht).Name).Range("A" & teller & ":Z" & teller).Value
    I = I + 1
    Next teller
    Next csht



    Thank you!

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: My macro runs on hidden sheets

    Duplicate post.

    http://www.excelforum.com/excel-prog...-shouldnt.html

+ 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. Viewing Hidden Sheets with a macro
    By Shazz in forum Excel General
    Replies: 9
    Last Post: 03-13-2012, 02:22 PM
  2. Macro to find hidden sheets
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-14-2011, 02:26 PM
  3. Macro to print on sheets which are not hidden
    By BRISBANEBOB in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-23-2008, 04:40 AM
  4. this macro runs, but not with a filter on the sheets?
    By matthias in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-11-2006, 04:45 PM
  5. [SOLVED] Macro and hidden sheets
    By Metallo in forum Excel General
    Replies: 7
    Last Post: 01-19-2006, 05:35 AM

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