May 05 2022 12:09 PM
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 it moved the entire row. I'm trying to move a range of data, not the entire row. Thanks!
Jun 08 2022 08:56 AM
Aug 30 2022 12:21 PM
Aug 30 2022 12:30 PM
Do you want to copy them to columns A, E and F, or for example to columns A, B and C?
Aug 30 2022 12:33 PM
Aug 30 2022 02:42 PM
If you have Microsoft 365 or Office 2021, you can use the Filter function to copy specific columns to another sheet.
Advanced Filter is another option.
If you still prefer a macro, here is an example.
Sub Copy_cells_to_another_sheet()
Dim myCell As Range
Dim w As Worksheet
Dim s As Long
Dim m As Long
Dim t As Long
Dim rng As Range
' Target sheet
Set w = Worksheets("Sheet2")
t = w.Range("A" & w.Rows.Count).End(xlUp).Row
Application.ScreenUpdating = False
' We're going to copy data from rows in which column D contain "x"
m = Range("D" & Rows.Count).End(xlUp).Row
For s = 2 To m
If Range("D" & s).Value = "x" Then
t = t + 1
' Copy cells form columns A, E and F
Set rng = Range("A" & s & ",E" & s & ",F" & s)
rng.Copy Destination:=w.Range("A" & t)
End If
Next s
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
Apr 07 2023 03:34 AM
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