srwilson87
New Member
- Joined
- Apr 24, 2015
- Messages
- 5
- Office Version
- 365
- 2021
- 2019
- 2016
- 2013
- 2011
- 2010
- 2007
- 2003 or older
- Platform
- Windows
- MacOS
- Mobile
- Web
So I am very new to VBA, and I'm trying to piece together what I can on my own.
I have this code, used to remove data on a certain line, in reference to data being collected on a summary page.
I have employee's on row A7:B30 as Last Name/First Name. and their Data on each monthly tab there after.
As it is set up now, this macro would only work until 2015 Dec.. and does not follow suite with the page as a whole, being able to track a rolling year.
I'm wanting to know how to reference the Tabs by "YYYY MMM" so it will function later on. Also, how to reference the Names, and then delete their data accordingly,
vs by manual selection, and a macro for each row.
Any assistance, or even pointing in a direction to learn what i need to, would be of immense help.
I have this code, used to remove data on a certain line, in reference to data being collected on a summary page.
I have employee's on row A7:B30 as Last Name/First Name. and their Data on each monthly tab there after.
Code:
Sub ER_AB14()'
' EmployeeRemoval_A14:B14 Macro
'
'From here, on the Summary Page, it selects the name in the A:B column, Comment
'in J column, Supervisor in K column, and Hire Date in the L Column, and then
'clears the information.
Sheet("Year-to-Date Summary").Select
Range("A14:B14,J14:L14").Select
Selection.ClearContents
'On the summary page, Columns C:I, this data is fed by filling in dates for the
'following monthly tabs
'It now selects all data relevant to the employee on row 14, (row 13 for all the monthly tabs)
'and clears out all the information being fed into columns C:I
Sheets(Array("2014 JAN", "2014 FEB", "2014 MAR", "2014 APR", "2014 MAY", "2014 JUN", _
"2014 JUL", "2014 AUG", "2014 SEP", "2014 OCT", "2014 NOV", "2014 DEC", "2015 JAN", _
"2015 FEB", "2015 MAR", "2015 APR", "2015 MAY", "2015 JUN", "2015 JUL", "2015 AUG", _
"2015 SEP", "2015 OCT", "2015 NOV", "2015 DEC")).Select
Range("J13:AN13").Select
Selection.ClearContents
Sheets("Year-to-Date Summary").Select
Range("A14").Select
End Sub
As it is set up now, this macro would only work until 2015 Dec.. and does not follow suite with the page as a whole, being able to track a rolling year.
I'm wanting to know how to reference the Tabs by "YYYY MMM" so it will function later on. Also, how to reference the Names, and then delete their data accordingly,
vs by manual selection, and a macro for each row.
Any assistance, or even pointing in a direction to learn what i need to, would be of immense help.