#1
|
|||
|
|||
Auto Populate Sheets?
I have an Excel spreadsheet at work that is used to track my hours. However, the sheet given to us only covers one pay period at a time. So I'm trying to make one Excel document with sheets for each pay period. I did this last year as well, but it was very tedious to go through and do 26 sheets for 26 pay periods.
I was wondering if there was a way to auto-populate sheets so that I could get those 26 sheets with a few clicks, as opposed to copying, fixing data, copying, and fixing data. |
#2
|
|||
|
|||
Can you post a workbook with the template sheet and tell us what the first pay period should be ?
|
#3
|
|||
|
|||
Sure. Here.
|
#4
|
|||
|
|||
See if this works for you...
Removed passwords. Locked date cells. Sheets are protected without password. |
#5
|
|||
|
|||
That's neat. I'm assuming you used VBA code? I'm going to need to make some modifications to get it working properly for my purposes (the state financial year, and, thus, our year, is from July to June.) Is there a function I can look up to find the code, or?
Last edited by macropod; 07-27-2018 at 01:51 PM. Reason: Removed inflamatory comment |
#6
|
||||
|
||||
@Shanked
Please don't quote entire posts unnecessarily. They make threads hard to read. Thanks
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#7
|
|||
|
|||
Alt + F11 brings up the VBA environment.
All code is in Module1. |
#8
|
|||
|
|||
Any particular reason you set a specific year range? (just curious)
Last edited by ShankedS; 07-27-2018 at 10:36 AM. |
#9
|
|||
|
|||
specific year range...
2018 because that's where I got the 'beginning of time' date of Jan 6, 2018 which would have been the first pay period ending in calendar 2018. 2025 is just arbitrary to prevent something like 9999 being entered and Excel taking an eternity or crashing dealing with all the pay periods 'til then. Quote:
Mind if I ask why an .xls file when your profile shows Office 2010 ? |
#10
|
|||
|
|||
@NoSparks
Hmm. Well, technically I have Office 365 at home and Office 2007 at work, so I'm not sure why I set it to Office 2010. Code:
yr = Application.InputBox("Enter 4 digit year from 2018 to 2025", "Create Sheets For Entire Year", Year(Date + 365), , , , , 1) Code:
endDate = DateSerial(2018, 7, 7) 'end of first pay period for 2019: 7/07/2018 Last edited by ShankedS; 07-27-2018 at 12:35 PM. |
#11
|
|||
|
|||
I'll adjust and fully comment the code, just tell me which months are in the 2019 financial year.
July 2018 thru June 2019 or July 2019 thru June 2020 ? |
#12
|
|||
|
|||
@NoSparks
The first would be correct Last edited by ShankedS; 07-27-2018 at 12:36 PM. |
#13
|
|||
|
|||
This should do it
When replying, just click Post Reply button instead of Quote button. |
#14
|
||||
|
||||
Unnecessary quotes have been removed - Previous version of this post deleted
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post Last edited by Pecoflyer; 07-27-2018 at 11:38 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Auto populate & auto calculate values from other sections in the same word document | Frantic | Word VBA | 2 | 01-24-2015 04:54 PM |
Auto-populate?? | Futsal1st | Word | 1 | 05-23-2014 03:03 AM |
auto cell populate 2 | Stevejd58 | Excel | 3 | 08-20-2013 04:23 PM |
auto cell populate | Stevejd58 | Excel | 14 | 05-13-2013 02:22 AM |
auto populate to a PDF file | jerrymbna22 | Excel | 0 | 07-12-2010 02:19 PM |