Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Learning VB (Visual Basic)

Just one of the things I'm learning. https://github.com/hchiam/learning

TODO: find my high school VB/VBA projects (a game, a neural network simulation, and a gravity/atoms interaction simulation).

Counting cells by background color:

To get something like this in an Excel formula: (first range is cells to count, second range is cell to use color)

=GetColorCount(B18:G19,H20)

you need this: https://trumpexcel.com/count-colored-cells-in-excel/

'Code created by Sumit Bansal from https://trumpexcel.com
Function GetColorCount(CountRange As Range, CountColor As Range)
  Dim CountColorValue As Integer
  Dim TotalCount As Integer
  CountColorValue = CountColor.Interior.ColorIndex
  Set rCell = CountRange
  For Each rCell In CountRange
    If rCell.Interior.ColorIndex = CountColorValue Then
      TotalCount = TotalCount + 1
    End If
  Next rCell
  GetColorCount = TotalCount
End Function

About

Learning Visual Basic

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages