Closed Thread
Results 1 to 5 of 5

Macro that will clear contents of cell based on format of text in adjacent cell

Hybrid View

  1. #1
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

    Re: Macro that will clear contents of cell based on format of text in adjacent cell

    Maybe

    Dim Rng As Range
    Set Rng = Range("A1:A6")
        
        For Each cl In Rng
            With cl
                If .Offset(0, 1).Font.FontStyle = "Bold" Then
                    .ClearContents
                End If
            End With
        Next cl
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  2. #2
    Registered User
    Join Date
    11-14-2008
    Location
    Brooklyn, NY, USA
    Posts
    53

    Thumbs up Re: Macro that will clear contents of cell based on format of text in adjacent cell

    That did the trick!!! Thanks!

  3. #3
    Registered User
    Join Date
    01-15-2012
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Macro that will clear contents of cell based on format of text in adjacent cell

    Please tell me how to Move the cell value to adjacent cell based on indent or bold formatting rather than deleting, also need to insert a new row if two adjacent cells are in bold thanks in advance

Closed 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.6.0 RC 1