First off, I am very new; a 'newborn/infant' if you must, when it comes to VBA. I can accomplish the simplest of things to existing code, but do not know enough to write my own lines. so your help is greatly appreciated!!
so heres what I'm doing/needing:
i have a report that is ran each month. the data is extracted and pasted into a sheet where we track the data from all months. I recorded a macro that will copy a range of cells from the specific sheet and paste them into the desired location (i technically have a sheet for each department and have multiple departments). here is the first part my code: again, this will copy the data from the specified departments sheet and paste it in the needed location on our summary sheet... these lines are repeated for each department.
Sub pastepvc()
'
' pastepvc Macro
'
'
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets("PVC").Select
Range("C5:N21").Select
Selection.Copy
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("OPS").Select
Range("P197").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub
----------------------------------------------------------------------------------
Now what i'm trying to do:
Our main report that is used to extract the raw data is ran on a montly basis and because of this when Feb. report is generated we will see the Feb. numbers, but when March is generated, the PivotTable being used will no longer contain Feb info (we cant run this particular report Year-to-Date due to the size; we'd only fit a couple of months on a sheet.). as you can see from the code, that will copy a set range of cells.
HOWEVER, it would be better if I could have it copy only the current months information and paste it in the current month column on our summary sheet.
sorry for the long read!!! hope that makes sense! ask any questions you have and please, please, please be gentle on me! hahah
THANK YOU TO EVERYONE FOR READING AND ESPECIALLY FOR HELPING!!
so heres what I'm doing/needing:
i have a report that is ran each month. the data is extracted and pasted into a sheet where we track the data from all months. I recorded a macro that will copy a range of cells from the specific sheet and paste them into the desired location (i technically have a sheet for each department and have multiple departments). here is the first part my code: again, this will copy the data from the specified departments sheet and paste it in the needed location on our summary sheet... these lines are repeated for each department.
Sub pastepvc()
'
' pastepvc Macro
'
'
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets("PVC").Select
Range("C5:N21").Select
Selection.Copy
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("OPS").Select
Range("P197").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub
----------------------------------------------------------------------------------
Now what i'm trying to do:
Our main report that is used to extract the raw data is ran on a montly basis and because of this when Feb. report is generated we will see the Feb. numbers, but when March is generated, the PivotTable being used will no longer contain Feb info (we cant run this particular report Year-to-Date due to the size; we'd only fit a couple of months on a sheet.). as you can see from the code, that will copy a set range of cells.
HOWEVER, it would be better if I could have it copy only the current months information and paste it in the current month column on our summary sheet.
sorry for the long read!!! hope that makes sense! ask any questions you have and please, please, please be gentle on me! hahah
THANK YOU TO EVERYONE FOR READING AND ESPECIALLY FOR HELPING!!