Dear all,
I would like to copy then paste to another sheet (sheet "Done") with same format without Zero (0) value but include negative (-) value in column G.
Please help, thank you before.
Regards
Dear all,
I would like to copy then paste to another sheet (sheet "Done") with same format without Zero (0) value but include negative (-) value in column G.
Please help, thank you before.
Regards
Make a Command Button on your sheet
And add this macro
![]()
Sub DataCopy() For MY_ROWS_1 = 1 To Sheets(1).Range("A65536").End(xlUp).Row If Sheets("SUMMARY ALL AGENT").Range("G" & MY_ROWS_1).Value > 0 Then Sheets("SUMMARY ALL AGENT").Range("A" & MY_ROWS_1 & ":G" & MY_ROWS_1).Copy _ Sheets("DONE").Range("A65536").End(xlUp).Offset(1, 0) End If Next MY_ROWS_1 End Sub
Dear AmirSoft
Thank you for your kind help, but when i run the macro it error "Variable not defined" with debug highlight in "MY_ROWS_1"
Hello,
Run the procedure CopyFilteredData
Thanks![]()
Option Explicit Sub CopyFilteredData() Dim shSource As Worksheet Dim shTarget As Worksheet Dim rData As Range Call TurnExtrasOff Set shSource = Sheets("SUMMARY ALL AGENT") Set shTarget = Sheets("DONE") Set rData = shSource.Range("A6", shSource.Cells(shSource.Rows.Count, "A").End(xlUp)).Resize(, 7) With rData ' Filter the data. .AutoFilter Field:=7, Criteria1:="<>0", Operator:=xlAnd, Criteria2:="<>" ' Copy the data. .SpecialCells(xlCellTypeVisible).Copy Destination:=shTarget.Range("A6") ' Clear the filter. .AutoFilter Field:=7 End With Call TurnExtrasOn ' Clean up Set rData = Nothing Set shSource = Nothing Set shTarget = Nothing End Sub Sub TurnExtrasOff() With Application .ScreenUpdating = False .EnableEvents = False .Calculation = xlCalculationManual End With End Sub Sub TurnExtrasOn() With Application .ScreenUpdating = True .EnableEvents = True .Calculation = xlCalculationAutomatic End With End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks