+ Reply to Thread
Results 1 to 2 of 2

A One-liner

  1. #1
    Forum Contributor
    Join Date
    08-20-2005
    Posts
    173

    A One-liner

    Hi I think there is something wrong with "For Each wks In ActiveWorkbook",
    any help is much appreciated.


    Sub taz()

    Dim wks As Worksheet
    Dim ActiveWorkbook As Workbook
    For Each wks In ActiveWorkbook

    If Cells(3, 1) = "taz" Then
    Cells.Font.Bold = True

    End If
    Next wks
    End Sub

  2. #2
    Norman Jones
    Guest

    Re: A One-liner

    Hi T,

    Try replacing:

    > Dim wks As Worksheet
    > Dim ActiveWorkbook As Workbook
    > For Each wks In ActiveWorkbook


    with:

    Dim wks As Worksheet

    For Each wks In ActiveWorkbook.Worksheets


    ---
    Regards,
    Norman


    "T De Villiers" <T.De.Villiers.29p6a0_1150801208.634@excelforum-nospam.com>
    wrote in message
    news:T.De.Villiers.29p6a0_1150801208.634@excelforum-nospam.com...
    >
    > Hi I think there is something wrong with "For Each wks In
    > ActiveWorkbook",
    > any help is much appreciated.
    >
    >
    > Sub taz()
    >
    > Dim wks As Worksheet
    > Dim ActiveWorkbook As Workbook
    > For Each wks In ActiveWorkbook
    >
    > If Cells(3, 1) = "taz" Then
    > Cells.Font.Bold = True
    >
    > End If
    > Next wks
    > End Sub
    >
    >
    > --
    > T De Villiers
    > ------------------------------------------------------------------------
    > T De Villiers's Profile:
    > http://www.excelforum.com/member.php...o&userid=26479
    > View this thread: http://www.excelforum.com/showthread...hreadid=553558
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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