+ Reply to Thread
Results 1 to 4 of 4

Clear Contents - NonBold cells

  1. #1
    Steve
    Guest

    Clear Contents - NonBold cells

    I have roughly 500-700 rows of information. All of my information is between
    columns B and K. I would like to run a macro the clears the contents of the
    cells based on NonBold font. For example; if b12 is is not bold, i want to
    clear contents on b12:k12. Can anyone help?

    Thanks,
    Steve

  2. #2
    Trevor Shuttleworth
    Guest

    Re: Clear Contents - NonBold cells

    Steve

    some examples:

    Sub test1()
    If Range("B12").Font.Bold = False Then
    Range("B12:K12").Clear
    End If
    End Sub

    Sub test2()
    Dim i As Long
    For i = 2 To 14
    If Range("B" & i).Font.Bold = False Then
    Range("B" & i & ":K" & i).Clear
    End If
    Next 'i
    End Sub

    The first is specific to row 12; the second is for rows 2 to 14 - change to
    suit.

    Regards

    Trevor


    "Steve" <sgauer@neo.rr.com.nospamallowed> wrote in message
    news:CCA81DA5-E990-4EA8-91EB-3FB221BD37FB@microsoft.com...
    >I have roughly 500-700 rows of information. All of my information is
    >between
    > columns B and K. I would like to run a macro the clears the contents of
    > the
    > cells based on NonBold font. For example; if b12 is is not bold, i want to
    > clear contents on b12:k12. Can anyone help?
    >
    > Thanks,
    > Steve




  3. #3
    Steve
    Guest

    Re: Clear Contents - NonBold cells

    Worked great. Thanks Trevor.

    "Trevor Shuttleworth" wrote:

    > Steve
    >
    > some examples:
    >
    > Sub test1()
    > If Range("B12").Font.Bold = False Then
    > Range("B12:K12").Clear
    > End If
    > End Sub
    >
    > Sub test2()
    > Dim i As Long
    > For i = 2 To 14
    > If Range("B" & i).Font.Bold = False Then
    > Range("B" & i & ":K" & i).Clear
    > End If
    > Next 'i
    > End Sub
    >
    > The first is specific to row 12; the second is for rows 2 to 14 - change to
    > suit.
    >
    > Regards
    >
    > Trevor
    >
    >
    > "Steve" <sgauer@neo.rr.com.nospamallowed> wrote in message
    > news:CCA81DA5-E990-4EA8-91EB-3FB221BD37FB@microsoft.com...
    > >I have roughly 500-700 rows of information. All of my information is
    > >between
    > > columns B and K. I would like to run a macro the clears the contents of
    > > the
    > > cells based on NonBold font. For example; if b12 is is not bold, i want to
    > > clear contents on b12:k12. Can anyone help?
    > >
    > > Thanks,
    > > Steve

    >
    >
    >


  4. #4
    Trevor Shuttleworth
    Guest

    Re: Clear Contents - NonBold cells

    You are very welcome


    "Steve" <sgauer@neo.rr.com.nospamallowed> wrote in message
    news:851A8C2B-4A55-4137-A875-236783F57D86@microsoft.com...
    > Worked great. Thanks Trevor.
    >
    > "Trevor Shuttleworth" wrote:
    >
    >> Steve
    >>
    >> some examples:
    >>
    >> Sub test1()
    >> If Range("B12").Font.Bold = False Then
    >> Range("B12:K12").Clear
    >> End If
    >> End Sub
    >>
    >> Sub test2()
    >> Dim i As Long
    >> For i = 2 To 14
    >> If Range("B" & i).Font.Bold = False Then
    >> Range("B" & i & ":K" & i).Clear
    >> End If
    >> Next 'i
    >> End Sub
    >>
    >> The first is specific to row 12; the second is for rows 2 to 14 - change
    >> to
    >> suit.
    >>
    >> Regards
    >>
    >> Trevor
    >>
    >>
    >> "Steve" <sgauer@neo.rr.com.nospamallowed> wrote in message
    >> news:CCA81DA5-E990-4EA8-91EB-3FB221BD37FB@microsoft.com...
    >> >I have roughly 500-700 rows of information. All of my information is
    >> >between
    >> > columns B and K. I would like to run a macro the clears the contents of
    >> > the
    >> > cells based on NonBold font. For example; if b12 is is not bold, i want
    >> > to
    >> > clear contents on b12:k12. Can anyone help?
    >> >
    >> > Thanks,
    >> > Steve

    >>
    >>
    >>




+ 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