Forum Discussion
cak980
May 05, 2022Copper Contributor
Using VBA to move a range of data to a different sheet when complete (need the for dummies version)
I'm trying to setup a macro so that when a task is completed (indicated with X), it automatically gets moved to a separate tab and deleted from original location. I was able to accomplish this but i...
HansVogelaar
May 05, 2022MVP
What is the code you're using now?
- cak980May 05, 2022Copper ContributorSub move_rows_to_another_sheet()
For Each myCell In Selection.Columns(4).Cells
If myCell.Value = "Closed" Then
myCell.EntireRow.Copy Worksheets("Sheet2").Range("A" & Rows.Count).End(3)(2)
myCell.EntireRow.Delete
End If
Next
End Sub- Rajesh950Apr 07, 2023Copper Contributor
hi team
i need a code in which i can move my cells data to another sheet ,
like i have data in cells A to I
and if i write c in cell I1 then it should move data from cell A to I into another worksheet
thanks
- HansVogelaarMay 05, 2022MVP
Thanks!
Because you use EntireRow, the entire row gets moved.
Which column or columns in the row would you like to move?
- austin2134Aug 30, 2022Copper ContributorI found the same code online and i'm changing it to fit my file.
I also only want to extract from certain columns "A","E", and "F". What would you change in this row:
myCell.EntireRow.Copy Worksheets("Sheet2").Range("A" & Rows.Count).End(3)(2)