Results 1 to 3 of 3

Expand selection to multiple cells

Threaded View

bobbybill Expand selection to multiple... 08-09-2012, 10:36 AM
arlu1201 Re: Edit of this code 08-09-2012, 10:40 AM
Pichingualas Re: Expand selection to... 08-09-2012, 10:53 AM
  1. #1
    Registered User
    Join Date
    08-08-2012
    Location
    minneapolis
    MS-Off Ver
    Excel 2011
    Posts
    12

    Expand selection to multiple cells

    Sub test()
    '
    
    'Determine Value to work with
    Dim x As String
    x = "=" & """" & ActiveCell.Value & """"
    
    'Delete all formatting
    For Each wb In Sheets
        wb.Select
        Cells.FormatConditions.Delete
    Next wb
    
    'Add new formatting on every sheet
    For Each wb In Sheets
        wb.Select
        Cells.Select
        Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
            Formula1:=x
        Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
        With Selection.FormatConditions(1).Font
            .Color = -16383844
            .TintAndShade = 0
        End With
        With Selection.FormatConditions(1).Interior
            .PatternColorIndex = xlAutomatic
            .Color = 13551615
            .TintAndShade = 0
        End With
    Next wb
    
    End Sub
    What I am looking to do is expand my selection to multiple (non-consecutive) cells. Instead of just 1 at a time. Thanks!
    Last edited by bobbybill; 08-09-2012 at 10:49 AM.

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