+ Reply to Thread
Results 1 to 3 of 3

color selector

  1. #1
    Steve
    Guest

    color selector

    Good day,

    Is there any VBA code that will pop up the Excel cell shading pallete and
    allow the user to select the color. Then, I want to store the number of the
    color that they have selected for later use. Kind of like the
    "GetOpenFileName" method, but open the cell shading colors instead.

    Thanks,

  2. #2
    Bob Phillips
    Guest

    Re: color selector

    Function ReturnColorindex(Optional Text As Boolean = False) As Long
    Dim rngCurr As Range
    Set rngCurr = Selection
    Application.ScreenUpdating = False
    Range("IV1").Select
    Application.Dialogs(xlDialogPatterns).Show
    ReturnColorindex = ActiveCell.Interior.ColorIndex
    If ReturnColorindex = xlColorIndexAutomatic And Not Text Then
    ReturnColorindex = xlColorIndexNone
    End If
    ActiveCell.Interior.ColorIndex = xlColorIndexAutomatic
    rngCurr.Select
    Set rngCurr = ActiveSheet.UsedRange
    End Function


    --
    HTH

    Bob Phillips

    "Steve" <[email protected]> wrote in message
    news:[email protected]...
    > Good day,
    >
    > Is there any VBA code that will pop up the Excel cell shading pallete and
    > allow the user to select the color. Then, I want to store the number of

    the
    > color that they have selected for later use. Kind of like the
    > "GetOpenFileName" method, but open the cell shading colors instead.
    >
    > Thanks,




  3. #3
    Tom Ogilvy
    Guest

    Re: color selector

    No, not really.

    If you pop it up, then when they select a color it will be provided to the
    active cell.

    If that is fine, then you can query the activecell for the colorindex
    select.

    Sub ABCD()
    Application.Dialogs(xlDialogPatterns).Show
    Msgbox ActiveCell.Interior.ColorIndex
    End Sub

    --
    Regards,
    Tom Ogilvy


    "Steve" <[email protected]> wrote in message
    news:[email protected]...
    > Good day,
    >
    > Is there any VBA code that will pop up the Excel cell shading pallete and
    > allow the user to select the color. Then, I want to store the number of

    the
    > color that they have selected for later use. Kind of like the
    > "GetOpenFileName" method, but open the cell shading colors instead.
    >
    > Thanks,




+ 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