I've got a excel workbook that has a macro written. It takes information from one sheet and pastes it to another. However each month the data range changes. Currently tracking a 12 month roll. So current month is Feb we use data from Feb 2014 - Jan 2015.
That being said there is the current date on both sheets. Is there a way to add to my pre-existing macro to paste it into the correct cells that line up with the correct date range. Or to take the data 12 lines and paste it into the other sheet on the current month range?
Sub Paste_to_UnitProfile()
'
' Paste_to_UnitProfile Macro
'
'
Range("D2:D13").Select
Selection.Copy
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("Unit Profile").Select
Range("G151").Select
ActiveSheet.Paste
End Sub
I'm adding the INDEX/MATCH that I tried to use on this but I'm new to this and I'm sure there's something small that I'm goofing up on:
=INDEX(PS250-'1EngineHours'!D2:D13,MATCH(E151,UnitProfile!G151:G170,0))
Aucun commentaire:
Enregistrer un commentaire