Results 1 to 7 of 7

Thread: How to add 5 star rating cell using MS excel

  1. #1
    Join Date
    May 2011
    Posts
    58

    How to add 5 star rating cell using MS excel

    I am new to this forum and I want to create a column which is having the a cell and in that cell there should be 5 stars in the cell and in this you can also click on the stars as it is provided on various websites or it is similar to the ratting application. So is there any application in which I can do ratting. So where can I find this application. I find the application but I was not able to find it. Please help me in solving the problem. Thanking all in advanced for helping me.

  2. #2
    Join Date
    Jun 2009
    Posts
    1,518

    Re: How to add 5 star rating cell using MS excel

    I was having the same scenario I asked by programmer friend and he told me that you have to use a simple formula such as the A1: =REPT (CHAR (171), B1) in which the in which the A1 stands for the cell to the holding ratings and the B1 stands for the data validation and for the option of the list or the list option and the list should be in list = 1, 2, 3, 4, 5 then you have to set the A1 to their alternative wingding’s and then you should use the formula that is given to you.

  3. #3
    Join Date
    Nov 2008
    Posts
    1,514

    Re: How to add 5 star rating cell using MS excel

    I was also having the same problem but in this case I was trying to do some rating in excel and the rating is in this type
    1 star- better
    2 star-very well
    3 star- good
    4 star- best
    5 star - excellent
    You have to just follow the code:
    Code:
    Private Sub change ()
    
    With Range ("B2")
        If .Value = "GOOD" Then
        Range ("C2").Value = "1"
        Else
        End If
    End With
    
    End Sub

  4. #4
    Join Date
    Mar 2009
    Posts
    1,360

    Re: How to add 5 star rating cell using MS excel

    If you are able to put the numbers or the ratings in the separate cell then you have to just use the formula REPT (CHAR (182), A1) this is the formula and it is still formatted in the Wingding’s and in this case this formula will display multiple stars. If in this case you have to format the star then you have to format each star and you can format the star by using the formula and then you have to select the characters and then the formula bar and then select the formats and then change the font color and the cell color.

  5. #5
    Join Date
    Nov 2008
    Posts
    1,259

    Re: How to add 5 star rating cell using MS excel

    From the discussion going on if the problem is not solved with the help of the formula, and then you can solve the problem by using the code. The code is as follows:
    Code:
    Option Explicit
    Private Sub Workbook_Open()
    Sheet1.RemoveHs
    End Sub
    
    Option Explicit
    Dim SC As Long
    Dim Lc, Tc As Long
    Dim Grade, i As Long
    Dim H, H1, H2, H3, H4, H5 As Shape
    
    Private Sub Worksheet_Activate()
    [B:B].Font.ColorIndex = 2
    End Sub
    
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
    With ActiveSheet
    
    If Target.Column > 1 Then
    RemoveHs
    Exit Sub
    End If
    
    If Target.Count > 1 Then
    RemoveHs
    Exit Sub
    End If
    
    If Target.Value = "" Then
    RemoveHs
    Exit Sub
    End If
    
    Lc = Target.Offset(0, 1).Left
    Tc = Target.Offset(0, 1).Top
    
    SC = Shapes.Count
    
    If SC > 0 Then
    RemoveHs
    AddHs
    Else
    AddHs
    End If
    
    End With
    
    End Sub
    Sub RemoveHs()
    
    With ActiveSheet
    
    SC = Shapes.Count
    
    If SC > 0 Then
    Shapes.SelectAll
    Selection.Delete
    End If
    
    End With
    
    End Sub
    Sub AddHs()
    
    With ActiveSheet
    
    Set H1 = Shapes.AddShape(msoShape5pointH, Lc, Tc, 10,
    10)
    H1.Name = "H1"
    H1.OnAction = "Sheet1.ClickH1"
    
    Set H2 = Shapes.AddShape(msoShape5pointH, Lc + 12, Tc,
    10, 10)
    H2.Name = "H2"
    H2.OnAction = "Sheet1.ClickH2"
    
    Set H3 = Shapes.AddShape(msoShape5pointH, Lc + 24, Tc,
    10, 10)
    H3.Name = "H3"
    H3.OnAction = "Sheet1.ClickH3"
    
    Set H4 = Shapes.AddShape(msoShape5pointH, Lc + 36, Tc,
    10, 10)
    H4.Name = "H4"
    H4.OnAction = "Sheet1.ClickH4"
    
    Set H5 = Shapes.AddShape(msoShape5pointH, Lc + 48, Tc,
    10, 10)
    H5.Name = "H5"
    H5.OnAction = "Sheet1.ClickH5"
    
    End With
    ColouredHs
    End Sub
    
    Sub ColouredHs()
    
    Grade = ActiveCell.Offset(0, 1).Value
    
    For Each H In ActiveSheet.Shapes
    i = Right(H.Name, 1)
    If i <= Grade Then
    H.Fill.PresetGradient msoGradientDiagonalUp, 1,
    msoGradientGold
    End If
    Next H
    
    End Sub
    Sub ClearHs()
    For Each H In ActiveSheet.Shapes
    H.Fill.Solid
    H.Fill.ForeColor.SchemeColor = 9
    Next H
    ColouredHs
    End Sub
    Sub ClickH1()
    ActiveCell.Offset(0, 1).Value = 1
    ClearHs
    End Sub
    Sub ClickH2()
    ActiveCell.Offset(0, 1).Value = 2
    ClearHs
    End Sub
    Sub ClickH3()
    ActiveCell.Offset(0, 1).Value = 3
    ClearHs
    End Sub
    Sub ClickH4()
    ActiveCell.Offset(0, 1).Value = 4
    ClearHs
    End Sub
    Sub ClickH5()
    ActiveCell.Offset(0, 1).Value = 5
    ClearHs
    End Sub

  6. #6
    Join Date
    Nov 2008
    Posts
    1,185

    Re: How to add 5 star rating cell using MS excel

    While I was surfing on the internet I saw the questions and the suggestions I would like to recommend you that you should use the formula REPT (CHAR (182), A1) this formula will help you to change the cell color and then display the cell settings.

  7. #7
    Join Date
    May 2011
    Posts
    58

    Re: How to add 5 star rating cell using MS excel

    Thank you for giving me the replies and now the problem has been solved for the 5 star rating cells using MS excel I solved the problem by just using the code that is suggested above and now I am just rating the cell and I also used use the formula REPT (CHAR (182), A1) and I am also able to change the color of the cell. And now I am changing the cell color and the I am also rating the cell stars.

Similar Threads

  1. How to disable excel for taking empty cell in Excel chart
    By Hache hi in forum MS Office Support
    Replies: 2
    Last Post: 25-02-2012, 12:30 PM
  2. Applying absolute cell referencing to many cell in Excel
    By Nyota in forum MS Office Support
    Replies: 2
    Last Post: 24-02-2012, 07:23 PM
  3. Cell format errors appears in Excel 2003 but not in Excel 2000
    By @nki$achi in forum MS Office Support
    Replies: 1
    Last Post: 24-01-2012, 05:00 PM
  4. Replies: 2
    Last Post: 04-01-2012, 06:54 PM
  5. Is it possible to use the star rating in photo viewer
    By Zared in forum Windows Software
    Replies: 4
    Last Post: 30-12-2010, 01:01 AM

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
  •  
Page generated in 1,750,557,877.77677 seconds with 16 queries