TechArena Community How to add 5 star rating cell using MS excel

# How to add 5 star rating cell using MS excel

## Windows Software

#1
09-07-2011
 Member 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
09-07-2011
 Member 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
09-07-2011
 Member 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
09-07-2011
 Member 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
09-07-2011
 Member 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 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
Else
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

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()

For Each H In ActiveSheet.Shapes
i = Right(H.Name, 1)
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
09-07-2011
 Member 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
10-07-2011
 Member 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.

 Tags: