Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: For Each c In Worksheets("1").range("I2:I100")

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Posts
    117
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi-
    The formula:

    For Each c In Worksheets("1").range("I2:I100")

    Will search for a c value in sheet 1, range I2 to I100. Say if I have 12 sheets named 1 thruogh 12 and I want the c.value to search in each sheet,range I2 to I200. How would one adjust this code so that it searches all 12 sheets at once??

  2. #2
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-27 17:13, Todd_M wrote:
    Hi-
    The formula:

    For Each c In Worksheets("1").range("I2:I100")

    Will search for a c value in sheet 1, range I2 to I100. Say if I have 12 sheets named 1 thruogh 12 and I want the c.value to search in each sheet,range I2 to I200. How would one adjust this code so that it searches all 12 sheets at once??
    This will search ALL sheets;



    Dim Sh As Worksheet

    For Each Sh In ActiveWorkbook.Sheets
    For Each c In Sh.Range("I2:I100")
    '//
    Next c
    Next Sh



    Kind Regards,
    Ivan F Moala From the City of Sails

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Posts
    117
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks Ivan, This works well!!

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •