Hi,
I have a table to which I wish to add data. Previously, I've been simply copying an entire row to the next blank row (from one sheet of input data to an archive), but I've recently began to poke around with the power of using tables. With that said, I'm struggling to adjust to the new method of working a little. My source data is added to the archive when the macro is ran (QAT button) and by checking Column C. I was using the logic "for each range in C:C if range "Complete" entirerow.copy" and then pasting it to the archive sheet.
The below code is as far as I've got attempting to convert that logic, but obviously it doesn't work.
Thanks for any help
I have a table to which I wish to add data. Previously, I've been simply copying an entire row to the next blank row (from one sheet of input data to an archive), but I've recently began to poke around with the power of using tables. With that said, I'm struggling to adjust to the new method of working a little. My source data is added to the archive when the macro is ran (QAT button) and by checking Column C. I was using the logic "for each range in C:C if range "Complete" entirerow.copy" and then pasting it to the archive sheet.
The below code is as far as I've got attempting to convert that logic, but obviously it doesn't work.
VBA Code:
Sub MoveCompletedTasks2()
Dim sTasks As Worksheet
Dim cTasks As Worksheet
Dim archTable As ListObject
Dim newRow As ListRow
Set sTasks = ThisWorkbook.Sheets("Test")
Set Archive = ThisWorkbook.Sheets("Archive")
Set archTable = Archive.ListObjects("Archive")
Set newRow = archTable.ListRows.Add()
For Each cell In sTasks.Range("C:C")
If cell.Value = "Complete" Then newRow = cell.EntireRow.Value
Next cell
End Sub
Thanks for any help