Clean Data with ChatGPT: Extract Incomplete Employee Records to a New Sheet
HTML-код
- Опубликовано: 28 июн 2024
- 00:25 Business Scenario
01:27 Write Code in ChatGPT
03:07 Second Trial
05:06 Third Trial
VBA Code used in this video:
_____________________________________________________
Sub MoveRowsToEENoSalary()
Dim wsSource As Worksheet
Dim wsDestination As Worksheet
Dim lastRow As Long
Dim i As Long
' Set the source and destination sheets
Set wsSource = ThisWorkbook.Sheets("employee_records")
Set wsDestination = ThisWorkbook.Sheets("EE with no salary")
' Find the last row with data in column A of the source sheet
lastRow = wsSource.Cells(wsSource.Rows.Count, "A").End(xlUp).Row
' Loop through each row from the bottom to the top to avoid issues with deletion
For i = lastRow To 2 Step -1
' Check if the cell value in column H is blank
If IsEmpty(wsSource.Cells(i, "H").Value) Then
' Move the entire row to the destination sheet
wsSource.Rows(i).Copy
wsDestination.Rows(wsDestination.Cells(wsDestination.Rows.Count, "H").End(xlUp).Row + 1).Insert Shift:=xlDown
Application.CutCopyMode = False ' Clear the clipboard
End If
Next i
End Sub
_____________________________________________________
Related Links:
openai.com/blog/chatgpt
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 - Хобби