00:19 Business Scenario
01:35 Write Code in ChatGPT
03:33 Second Trial
VBA Code used in this video:
_____________________________________________________
Sub ColorCellsBasedOnValue()
Dim ws As Worksheet
Dim rng As Range
Dim cell As Range
Dim cellValue As Double
' Change the sheet name to the actual sheet name
Set ws = ThisWorkbook.Sheets("employee_records")
' Assuming the data starts from row 2 in Column H, change the range as needed
Set rng = ws.Range("H2:H" & ws.Cells(ws.Rows.Count, "H").End(xlUp).Row)
For Each cell In rng
If IsNumeric(cell.Value) Then
cellValue = CDbl(cell.Value)
If cellValue [LESS THAN OR EQUAL TO - ANGLED BRACKET] 0.8 Then
cell.Interior.Color = RGB(255, 204, 204) ' Light red
ElseIf cellValue [GREATER THAN OR EQUAL TO - ANGLED BRACKET] 1.2 Then
cell.Interior.Color = RGB(204, 255, 204) ' Light green
Else
cell.Interior.Color = RGB(255, 204, 0) ' Light yellow
End If
End If
Next cell
End Sub
_____________________________________________________
Related Links:
openai.com/blo...
Want to learn how to design a salary structure? Check: bit.ly/3r3KXeW
FREE template for my video: Excel for HR - Create Annual Employee Salary Increase Template from Scratch. You can download and try it out yourself here: bit.ly/2MLLdb7
FREE actual workbook for my video "Split a Master Spreadsheet into Multiple Sheets with 1 click - VBA for Beginner". You can download and try it out yourself here: bit.ly/2UmeX2v
*****More Videos in Playlists*****
Coding with ChatGPT bit.ly/3YtsmWe
Excel Macro - Beginner goo.gl/Yae5nc
Excel Macro/VBA - Splitting a Master File goo.gl/m8CHya
Excel Macro/VBA - Auto-hide Rows or Columns bit.ly/2Mzteb5
Excel vs Power BI: bit.ly/3NQWN51
Power BI for Beginners: bit.ly/3ivKitD
Power BI for Advanced Users: bit.ly/3lE9zmO
Excel for HR goo.gl/JdeVnd
Excel for HR - Master Class goo.gl/LYfq2f
Excel Charts Data Visualization goo.gl/2ao6BP
Excel Vlookup Function goo.gl/kP2Wpz
Excel Pivot Table Function goo.gl/rukkPs
Excel Array Function goo.gl/i4sQH8
Excel Index and Match Function goo.gl/i7VGU4
Excel Solver/Goal Seek Functions goo.gl/FTkTnj
Excel Cell Formatting Solutions goo.gl/gpa6MY
HR Analytics - Merit Matrix goo.gl/Koy7co
HR Analytics - Salary Structure goo.gl/uZBnFa
Excel Tricks goo.gl/TeqGDw
Excel Troubleshooting goo.gl/bdY5by
Fun HR Topics goo.gl/7zVg8h
#ExcelforHR#HRAnalytics#Excel#HR
Негізгі бет Clean Data with ChatGPT: Conditional Format Cells by Criteria
Пікірлер