Yea, I have no idea where to start. I have been all over google trying to figure out the structure. I have a VBA that i need to put into a script inorder to use it in AppSheet. Can you point me in the right direction?
Sub ResetWeekly()
End Sub
Sub ClearOldDates()
'Declare variables
Dim rng As Range
Dim fng As Range
Dim gng As Range
Dim sta As Range
Dim cell As Range
Dim today As Date
'Set the range to be looped through
Set rng = Range("E2:E49")
'Get today's date
today = Date
'Loop through each cell in the range
For Each cell In rng
'Check if the date in the cell is more than 7 days old
If cell.Value < DateAdd("d", -7, today) Then
'Clear the contents of the cell
cell.ClearContents
End If
Next cell
Set fng = Range("F2:F49")
today = Date
For Each cell In fng
If cell.Value < DateAdd("d", -7, today) Then
cell.ClearContents
End If
Next cell
Set gng = Range("g2:g49")
today = Date
For Each cell In gng
If cell.Value < DateAdd("d", -7, today) Then
cell.ClearContents
End If
Next cell
Set sta = Range("h2:h49")
For Each cell In sta
If cell.Value = "" Then Intersect(sta.EntireRow, Columns("H:H")).ClearContents
Next cell
End Sub
Sub ResetWeekly()
End Sub
Sub ClearOldDates()
'Declare variables
Dim rng As Range
Dim fng As Range
Dim gng As Range
Dim sta As Range
Dim cell As Range
Dim today As Date
'Set the range to be looped through
Set rng = Range("E2:E49")
'Get today's date
today = Date
'Loop through each cell in the range
For Each cell In rng
'Check if the date in the cell is more than 7 days old
If cell.Value < DateAdd("d", -7, today) Then
'Clear the contents of the cell
cell.ClearContents
End If
Next cell
Set fng = Range("F2:F49")
today = Date
For Each cell In fng
If cell.Value < DateAdd("d", -7, today) Then
cell.ClearContents
End If
Next cell
Set gng = Range("g2:g49")
today = Date
For Each cell In gng
If cell.Value < DateAdd("d", -7, today) Then
cell.ClearContents
End If
Next cell
Set sta = Range("h2:h49")
For Each cell In sta
If cell.Value = "" Then Intersect(sta.EntireRow, Columns("H:H")).ClearContents
Next cell
End Sub