Тёмный

Excel VBA Macro: Count and List the Number of (Conditonally Formatted) Cells at the End of Each Row 

greggowaffles
Подписаться 6 тыс.
Просмотров 1,2 тыс.
50% 1

Excel VBA Macro: Count and List the Number of (Conditonally Formatted) Cells at the End of Each Row
💥Subscribe: / @greggowaffles
This is a modification of code from:
www.excelsirji...
Code:
Sub list_cond_cells_per_row()
Dim rng As Range
Dim rngCell As Range
Dim row_count As Integer
Dim col_count As Integer
Dim cond_count As Integer
Dim i As Integer
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Sheet1")
ws.Activate
row_count = WorksheetFunction.CountA(Range("A1", Range("A1").End(xlDown)))
col_count = WorksheetFunction.CountA(Range("A1", Range("A1").End(xlToRight)))
For i = 2 To row_count
Set rng = ws.Range(Cells(i, 1), Cells(i, col_count))
cond_count = 0
For Each rngCell In rng
If Cells(rngCell.Row, rngCell.Column).DisplayFormat. _
Interior.Color = RGB(255, 199, 206) Then
cond_count = cond_count + 1
End If
Next
ws.Cells(i, col_count + 1) = cond_count
Next i
End Sub
#ExcelVBA #ExcelMacro

Опубликовано:

 

30 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 3   
@coolvideos4562
@coolvideos4562 8 месяцев назад
I have 1 year data but how to Filter one month data automatically Using VBA paste to new sheet
@kameya1104
@kameya1104 Год назад
I used lo do for loop for this kind of procedure, but now I prefer to use Do Until... i.e. Do Until Range("A" & i)="", then eliminate one extra variable like row_count.
@greggowaffles
@greggowaffles Год назад
Thanks for sharing that!!
Далее
ПОЮ ВЖИВУЮ🎙
3:19:12
Просмотров 881 тыс.
Лайфак года 😂
00:12
Просмотров 74 тыс.
EASILY Make an Automated Data Entry Form in Excel
14:52
VBA Macro to Delete Rows Based on Cell Values
9:32
Просмотров 141 тыс.
How to Move Data Automatically Between Excel Files
11:37