00:22 Business Scenario
01:26 Write Code in ChatGPT
VBA Code used in this video:
_____________________________________________________
Sub ReplaceTextInColumnD()
Dim ws As Worksheet
Dim lastRow As Long
Dim rng As Range
' Replace "research & development" with "research and development"
Const findText1 As String = "research & development"
Const replaceText1 As String = "research and development"
' Replace "supply-chains" with "supply chains"
Const findText2 As String = "supply-chains"
Const replaceText2 As String = "supply chains"
' Set the worksheet object
Set ws = ThisWorkbook.Sheets("employee_records")
' Find the last row in column D
lastRow = ws.Cells(ws.Rows.Count, "D").End(xlUp).Row
' Set the range for column D
Set rng = ws.Range("D1:D" & lastRow)
' Perform the first replacement
rng.Replace What:=findText1, Replacement:=replaceText1, LookAt:=xlPart, MatchCase:=False
' Perform the second replacement
rng.Replace What:=findText2, Replacement:=replaceText2, LookAt:=xlPart, MatchCase:=False
End Sub
_____________________________________________________
Related Links:
https://openai.com/blog/chatgpt
Want to learn how to design a salary structure? Check: https://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: https://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: https://bit.ly/2UmeX2v
*****More Videos in Playlists*****
Coding with ChatGPT https://bit.ly/3YtsmWe
Excel Macro - Beginner https://goo.gl/Yae5nc
Excel Macro/VBA - Splitting a Master File https://goo.gl/m8CHya
Excel Macro/VBA - Auto-hide Rows or Columns http://bit.ly/2Mzteb5
Excel vs Power BI: https://bit.ly/3NQWN51
Power BI for Beginners: https://bit.ly/3ivKitD
Power BI for Advanced Users: http://bit.ly/3lE9zmO
Excel for HR https://goo.gl/JdeVnd
Excel for HR - Master Class https://goo.gl/LYfq2f
Excel Charts Data Visualization https://goo.gl/2ao6BP
Excel Vlookup Function https://goo.gl/kP2Wpz
Excel Pivot Table Function https://goo.gl/rukkPs
Excel Array Function https://goo.gl/i4sQH8
Excel Index and Match Function https://goo.gl/i7VGU4
Excel Solver/Goal Seek Functions https://goo.gl/FTkTnj
Excel Cell Formatting Solutions https://goo.gl/gpa6MY
HR Analytics - Merit Matrix https://goo.gl/Koy7co
HR Analytics - Salary Structure https://goo.gl/uZBnFa
Excel Tricks https://goo.gl/TeqGDw
Excel Troubleshooting https://goo.gl/bdY5by
Fun HR Topics https://goo.gl/7zVg8h
#ExcelforHR#HRAnalytics#Excel#HR