ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Tagt Row When data copied to another workbook (https://www.excelbanter.com/excel-discussion-misc-queries/161200-tagt-row-when-data-copied-another-workbook.html)

kenny

Tagt Row When data copied to another workbook
 
Hello, I could really use some help. I am coping data from one workbook to
another after a filter. I need to tag column M on the New Tracker workbook
with the word "sent"; only for the records that was filterd and copied.
Please see the code below. I have a arrow pointing to my BAD CODE. At the end
of this sub I want to call another sub. How do I do that also? Thanks!

Private Sub DailyReport_Click()
ActiveSheet.Range("A2").AutoFilter Field:=12, Criteria1:="<"
Range(("M6"), Cells(Rows.Count, ("M:M")).End(xlUp)) = "Sent"
Application.ScreenUpdating = False
Workbooks.Open Filename:= _
"C:\Users\Kenny\Documents\Toyota\Floater\Daily Tracker Report.xls"
Windows("New Tracker.xls").Activate
Range(("L6"), Cells(Rows.Count, ("L:L")).End(xlUp)).Copy
Windows("Daily Tracker Report.xls").Activate
Worksheets("sheet1").Range("A5").PasteSpecial Paste:=xlPasteValues
Windows("New Tracker.xls").Activate
Range(("A6:B6"), Cells(Rows.Count, ("B:B")).End(xlUp)).Copy
Windows("Daily Tracker Report.xls").Activate
Worksheets("sheet1").Range("B5").PasteSpecial Paste:=xlPasteValues
Windows("New Tracker.xls").Activate
Range(("G6:K6"), Cells(Rows.Count, ("G:G")).End(xlUp)).Copy
Windows("Daily Tracker Report.xls").Activate
Worksheets("sheet1").Range("D5").PasteSpecial Paste:=xlPasteValues
Windows("New Tracker.xls").Activate
Range("A6").Select
'Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
'Selection.EntireRow.Delete
'Windows("Daily Tracker Report.xls").Activate
ActiveSheet.Range("A2").AutoFilter Field:=12
Application.ScreenUpdating = True
End Sub


FSt1

Tagt Row When data copied to another workbook
 
hi
to call another sub procedure use the call command.

call myothermacro

I don't see any arrows pointing to my bad code. I see some lines commented
out. did i miss something?

regards
FSt1



"Kenny" wrote:

Hello, I could really use some help. I am coping data from one workbook to
another after a filter. I need to tag column M on the New Tracker workbook
with the word "sent"; only for the records that was filterd and copied.
Please see the code below. I have a arrow pointing to my BAD CODE. At the end
of this sub I want to call another sub. How do I do that also? Thanks!

Private Sub DailyReport_Click()
ActiveSheet.Range("A2").AutoFilter Field:=12, Criteria1:="<"
Range(("M6"), Cells(Rows.Count, ("M:M")).End(xlUp)) = "Sent"
Application.ScreenUpdating = False
Workbooks.Open Filename:= _
"C:\Users\Kenny\Documents\Toyota\Floater\Daily Tracker Report.xls"
Windows("New Tracker.xls").Activate
Range(("L6"), Cells(Rows.Count, ("L:L")).End(xlUp)).Copy
Windows("Daily Tracker Report.xls").Activate
Worksheets("sheet1").Range("A5").PasteSpecial Paste:=xlPasteValues
Windows("New Tracker.xls").Activate
Range(("A6:B6"), Cells(Rows.Count, ("B:B")).End(xlUp)).Copy
Windows("Daily Tracker Report.xls").Activate
Worksheets("sheet1").Range("B5").PasteSpecial Paste:=xlPasteValues
Windows("New Tracker.xls").Activate
Range(("G6:K6"), Cells(Rows.Count, ("G:G")).End(xlUp)).Copy
Windows("Daily Tracker Report.xls").Activate
Worksheets("sheet1").Range("D5").PasteSpecial Paste:=xlPasteValues
Windows("New Tracker.xls").Activate
Range("A6").Select
'Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
'Selection.EntireRow.Delete
'Windows("Daily Tracker Report.xls").Activate
ActiveSheet.Range("A2").AutoFilter Field:=12
Application.ScreenUpdating = True
End Sub


kenny

Tagt Row When data copied to another workbook
 
sorry see the code again below

"FSt1" wrote:

hi
to call another sub procedure use the call command.

call myothermacro

I don't see any arrows pointing to my bad code. I see some lines commented
out. did i miss something?

regards
FSt1



"Kenny" wrote:

Hello, I could really use some help. I am coping data from one workbook to
another after a filter. I need to tag column M on the New Tracker workbook
with the word "sent"; only for the records that was filterd and copied.
Please see the code below. I have a arrow pointing to my BAD CODE. At the end
of this sub I want to call another sub. How do I do that also? Thanks!

Private Sub DailyReport_Click()
ActiveSheet.Range("A2").AutoFilter Field:=12, Criteria1:="<"
Range(("M6"), Cells(Rows.Count, ("M:M")).End(xlUp)) = "Sent" <=====this is not working copys to the entire column. I need it to only update column M with the aomunt of records of the sort above with the word sent
Application.ScreenUpdating = False
Workbooks.Open Filename:= _
"C:\Users\Kenny\Documents\Toyota\Floater\Daily Tracker Report.xls"
Windows("New Tracker.xls").Activate
Range(("L6"), Cells(Rows.Count, ("L:L")).End(xlUp)).Copy
Windows("Daily Tracker Report.xls").Activate
Worksheets("sheet1").Range("A5").PasteSpecial Paste:=xlPasteValues
Windows("New Tracker.xls").Activate
Range(("A6:B6"), Cells(Rows.Count, ("B:B")).End(xlUp)).Copy
Windows("Daily Tracker Report.xls").Activate
Worksheets("sheet1").Range("B5").PasteSpecial Paste:=xlPasteValues
Windows("New Tracker.xls").Activate
Range(("G6:K6"), Cells(Rows.Count, ("G:G")).End(xlUp)).Copy
Windows("Daily Tracker Report.xls").Activate
Worksheets("sheet1").Range("D5").PasteSpecial Paste:=xlPasteValues
Windows("New Tracker.xls").Activate
Range("A6").Select
'Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
'Selection.EntireRow.Delete
'Windows("Daily Tracker Report.xls").Activate
ActiveSheet.Range("A2").AutoFilter Field:=12
Application.ScreenUpdating = True
End Sub



All times are GMT +1. The time now is 01:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com