+ Reply to Thread
Results 1 to 2 of 2

Thread: Cycle Through Worksheets

  1. #1
    Registered User
    Join Date
    08-01-2010
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    1

    Cycle Through Worksheets

    I wrote a function that behaves like MATCH(), in that given a reference and lookup range, it will return the entire cell reference, not just the column or just the row.

    My function works on the current worksheet, but I can't get it to cycle through all of the worksheets in the book, and return the cell reference with full workbook/worksheet title.

    Can anyone show me how to write the loop that would search all of the worksheets? Pretend my function is blackbox, call it cellFinder().

    Thanks!

  2. #2
    Forum Guru pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2010
    Posts
    5,151

    Re: Cycle Through Worksheets

    Hi seams192
    Welcome to the forum
    does this help
    Option Explicit
    Sub tester()
    Dim ws As Worksheet
     For Each ws In Worksheets
     
     Debug.Print ws.Name
     
     Next
     End Sub
    regards pike

    If the solution helped please donate
    here to the RSPCA

    Sites worth visiting;

    J&R Solutions - royUK

    AJP Excel Information - Andy Pope

    Spreadsheet Toolbox

    VBA for smarties - snb

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0