Macro for Beginner: How to Automatically Format Cell based on Cell Value in 1 Click

preview_player
Показать описание
New course Launched! I created it to show you step-by-step how to design a salary structure with regression analysis in Excel. Check out the detail here:

Scenario: You want to automatically format cells based on what the cell contains and you don't want to use filter because:

1) Too many spreadsheets to manually filter and format each one;
2) Your spreadsheet is ever-changing

Function: Macro

***Macro Code 1***
Sub Format1Cell()
If InStr(1, ActiveSheet.Range("B5").Text, "Sales") Then
Range("B5").Interior.Color = vbYellow
End If
End Sub

***Macro Code 2***
Sub FormatMultipleCells()
Dim i As Integer
For i = 8 To 15
If InStr(1, ActiveSheet.Range("B" & i).Text, "Sales") Then
Range("B" & i).Interior.Color = vbYellow
End If
Next
End Sub

******Follow-up Consulting Services******

******More Videos in Playlists******

#ExcelforHR#HRAnalytics#Excel#HR
Рекомендации по теме
Комментарии
Автор

Very nice mam
I'm from Mysore India
If I want to format a range of cells in numeric and 65, 78, 657 like this mam how to do... Pl help
Pl visit Mysore do come to my home...
Thank you mam

slikith
welcome to shbcf.ru