Hi all - I hope this explanation makes sense. The code below was one i found here with a small modification to do what I needed.
I call the code via another macro.
If I step through the code in macro window using F8 it only copies any columns with data to last cell in column A... which at the moment is A150.
but if I run the macro by calling it from the first Macro it seems to copy the data down to row 181.... the last non-blank cell is Z181.
I have checked and ensured there is no data from A151 down..... not sure why it is copying it all.
hope that made sense.
I call the code via another macro.
Code:
Sub copyRawDataScholle()
Dim last_row As Long
'establishes last row in column A
last_row = Range("A" & Rows.Count).End(xlUp).Row
'copies the raw data and pastes back to scraps file only as values.
Workbooks("Finished Goods Yield Report - MASTER.xlsx").Worksheets("Scholle").Range("A2:z" & last_row).Copy
Workbooks("AC22 Scraps.xlsm").Worksheets("YR - Scholle").Range("A2").PasteSpecial Paste:=xlPasteValues
Workbooks("AC22 Scraps.xlsm").Activate
Worksheets("Production Cycles").Select
' enable screen updating
Application.ScreenUpdating = True
End Sub
If I step through the code in macro window using F8 it only copies any columns with data to last cell in column A... which at the moment is A150.
but if I run the macro by calling it from the first Macro it seems to copy the data down to row 181.... the last non-blank cell is Z181.
I have checked and ensured there is no data from A151 down..... not sure why it is copying it all.
hope that made sense.
Last edited: