Closed Thread
Results 1 to 2 of 2

Please Help Edit Existing Macro

Hybrid View

  1. #1
    Registered User
    Join Date
    03-04-2010
    Location
    South Florida
    MS-Off Ver
    Excel 2007
    Posts
    72

    Please Help Edit Existing Macro

    I would like to remove the "button" in the the code below and have the code show up in Developer > Macros. I would rather type the range in VBA depending on what I need Ex. (A1:H10).


    Sub Highlight_Duplicates(Values As Range)
    Dim Cell

    For Each Cell In Values
    If WorksheetFunction.CountIf(Values, Cell.Value) > 1 Then
    Cell.Interior.ColorIndex = 6
    End If

    Next Cell
    End Sub


    Private Sub CommandButton1_Click()
    Highlight_Duplicates (Sheets("Sheet1").Range("C10:F14"))

    End SubThanks.
    H

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Please Help Edit Existing Macro

    Please start a new thread with your code wrapped in CODE tags and a thread title that concisely describes your problem.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

Closed 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