filmov
tv
⚙️ Excel VBA Automation: Auto-Date To-Do Tasks in Real-Time! 📅🔍 #vba #automation

Показать описание
⚙️ Excel VBA Automation: Auto-Date To-Do Tasks in Real-Time! 📅🔍
Empower your Excel to-do list with automation! This VBA code works like magic. Whenever you enter text in your to-do list (column C), it dynamically adds the current date in the corresponding date column (column B). Boost your productivity and stay organized effortlessly.
VBA Code:
----------------------------------------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lastRow As Long
Dim ws As Worksheet
Dim i As Long
' Set the worksheet
Set ws = ThisWorkbook.Sheets("Sheet1") ' Change "Sheet1" to your actual sheet name
' Find the last row with data in column C
lastRow = ws.Cells(ws.Rows.Count, "C").End(xlUp).Row
' Loop through the rows starting from row 3
For i = 3 To lastRow
' Check if the cell in column C is not blank
If Not IsEmpty(ws.Cells(i, 3).Value) Then
' Check if the corresponding cell in column B is blank
If IsEmpty(ws.Cells(i, 2).Value) Then
' Enter today's date in the corresponding cell in column B
ws.Cells(i, 2).Value = Date
End If
End If
Next i
End Sub
----------------------------------------------------------------------------------------
Effortlessly manage your to-do list in Excel! This VBA code ensures that when you enter text in your to-do list, the corresponding date is automatically added. Boost your productivity with this smart Excel automation. ⚙️📅🔍 #ExcelVBA #ProductivityHacks #ExcelAutomation
Empower your Excel to-do list with automation! This VBA code works like magic. Whenever you enter text in your to-do list (column C), it dynamically adds the current date in the corresponding date column (column B). Boost your productivity and stay organized effortlessly.
VBA Code:
----------------------------------------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lastRow As Long
Dim ws As Worksheet
Dim i As Long
' Set the worksheet
Set ws = ThisWorkbook.Sheets("Sheet1") ' Change "Sheet1" to your actual sheet name
' Find the last row with data in column C
lastRow = ws.Cells(ws.Rows.Count, "C").End(xlUp).Row
' Loop through the rows starting from row 3
For i = 3 To lastRow
' Check if the cell in column C is not blank
If Not IsEmpty(ws.Cells(i, 3).Value) Then
' Check if the corresponding cell in column B is blank
If IsEmpty(ws.Cells(i, 2).Value) Then
' Enter today's date in the corresponding cell in column B
ws.Cells(i, 2).Value = Date
End If
End If
Next i
End Sub
----------------------------------------------------------------------------------------
Effortlessly manage your to-do list in Excel! This VBA code ensures that when you enter text in your to-do list, the corresponding date is automatically added. Boost your productivity with this smart Excel automation. ⚙️📅🔍 #ExcelVBA #ProductivityHacks #ExcelAutomation
Комментарии