Created
August 25, 2025 09:00
-
-
Save pravinmane85/3205ddfe684dd4922b65ef960b43cb02 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub RandomBlackCircles_OnePerRow_WithWhiteCircles() | |
| Dim rng As Range, rowRng As Range | |
| Dim colCount As Long, randCol As Long | |
| Dim i As Long, j As Long | |
| ' Set your target range here | |
| Set rng = Range("L2:M15") | |
| colCount = rng.Columns.Count | |
| Application.EnableEvents = False | |
| Application.ScreenUpdating = False | |
| ' Clear existing circles | |
| rng.ClearContents | |
| For i = 1 To rng.Rows.Count | |
| Set rowRng = rng.Rows(i) | |
| randCol = WorksheetFunction.RandBetween(1, colCount) | |
| For j = 1 To colCount | |
| With rowRng.Cells(1, j) | |
| If j = randCol Then | |
| .Value = ChrW(&H25CF) ' Black circle ? | |
| Else | |
| .Value = ChrW(&H25CB) ' White circle ? | |
| End If | |
| .Font.Name = "Arial Unicode MS" | |
| .Font.Size = 18 | |
| .Font.Color = vbBlack | |
| .Interior.Color = vbWhite | |
| .Borders.LineStyle = xlContinuous | |
| .Borders.Color = vbBlack | |
| End With | |
| Next j | |
| Next i | |
| Application.EnableEvents = True | |
| Application.ScreenUpdating = True | |
| End Sub | |
| Sub FillWhiteCirclesInSelection() | |
| Dim cell As Range | |
| For Each cell In Selection | |
| cell.Value = ChrW(&H25CB) ' Unicode white circle ? | |
| cell.Font.Name = "Arial Unicode MS" | |
| cell.Font.Size = 18 | |
| cell.Font.Color = vbBlack | |
| cell.Interior.Color = vbWhite | |
| cell.Borders.LineStyle = xlContinuous | |
| cell.Borders.Color = vbBlack | |
| Next cell | |
| End Sub | |
| Sub FillBlackCirclesInSelection() | |
| Dim cell As Range | |
| For Each cell In Selection | |
| cell.Value = ChrW(&H25CF) ' Unicode black circle ? | |
| cell.Font.Name = "Arial Unicode MS" | |
| cell.Font.Size = 18 | |
| cell.Font.Color = vbBlack | |
| cell.Interior.Color = vbWhite | |
| cell.Borders.LineStyle = xlContinuous | |
| cell.Borders.Color = vbBlack | |
| Next cell | |
| End Sub |
Author
Author
=L2 & ":" & INDEX({"A","B","C","D"},MATCH("●",M2:P2,0))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
=MATCH("●",L9:O9,0)