Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-26-2018, 09:59 AM
ShankedS ShankedS is offline Auto Populate Sheets? Windows 7 64bit Auto Populate Sheets? Office 2010 64bit
Advanced Beginner
Auto Populate Sheets?
 
Join Date: Oct 2014
Posts: 62
ShankedS is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 07-26-2018, 10:07 AM
NoSparks NoSparks is offline Auto Populate Sheets? Windows 7 64bit Auto Populate Sheets? Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

Can you post a workbook with the template sheet and tell us what the first pay period should be ?
Reply With Quote
  #3  
Old 07-26-2018, 10:36 AM
ShankedS ShankedS is offline Auto Populate Sheets? Windows 7 64bit Auto Populate Sheets? Office 2010 64bit
Advanced Beginner
Auto Populate Sheets?
 
Join Date: Oct 2014
Posts: 62
ShankedS is on a distinguished road
Default

Sure. Here.
Attached Files
File Type: xls new-Timesheet-2019.xls (100.0 KB, 7 views)
Reply With Quote
  #4  
Old 07-26-2018, 03:40 PM
NoSparks NoSparks is offline Auto Populate Sheets? Windows 7 64bit Auto Populate Sheets? Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

See if this works for you...
Removed passwords.
Locked date cells.
Sheets are protected without password.
Attached Files
File Type: xls new-Timesheet-2019_v2.xls (49.0 KB, 7 views)
Reply With Quote
  #5  
Old 07-27-2018, 07:02 AM
ShankedS ShankedS is offline Auto Populate Sheets? Windows 7 64bit Auto Populate Sheets? Office 2010 64bit
Advanced Beginner
Auto Populate Sheets?
 
Join Date: Oct 2014
Posts: 62
ShankedS is on a distinguished road
Default

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
Reply With Quote
  #6  
Old 07-27-2018, 07:08 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Auto Populate Sheets? Windows 7 64bit Auto Populate Sheets? Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,779
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

@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
Reply With Quote
  #7  
Old 07-27-2018, 07:15 AM
NoSparks NoSparks is offline Auto Populate Sheets? Windows 7 64bit Auto Populate Sheets? Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

Alt + F11 brings up the VBA environment.
All code is in Module1.
Reply With Quote
  #8  
Old 07-27-2018, 07:17 AM
ShankedS ShankedS is offline Auto Populate Sheets? Windows 7 64bit Auto Populate Sheets? Office 2010 64bit
Advanced Beginner
Auto Populate Sheets?
 
Join Date: Oct 2014
Posts: 62
ShankedS is on a distinguished road
Default

Any particular reason you set a specific year range? (just curious)

Last edited by ShankedS; 07-27-2018 at 10:36 AM.
Reply With Quote
  #9  
Old 07-27-2018, 08:05 AM
NoSparks NoSparks is offline Auto Populate Sheets? Windows 7 64bit Auto Populate Sheets? Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

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:
the state financial year, and, thus, our year, is from July to June
so July 2019 is the first month in the 2019 financial year ?

Mind if I ask why an .xls file when your profile shows Office 2010 ?
Reply With Quote
  #10  
Old 07-27-2018, 08:13 AM
ShankedS ShankedS is offline Auto Populate Sheets? Windows 7 64bit Auto Populate Sheets? Office 2010 64bit
Advanced Beginner
Auto Populate Sheets?
 
Join Date: Oct 2014
Posts: 62
ShankedS is on a distinguished road
Default

@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)
So what's going on here, exactly? You mention you set the date to January 6th, 2018, but changed that to:


Code:
endDate = DateSerial(2018, 7, 7)  'end of first pay period for 2019: 7/07/2018
However, it still goes Jan -> December. Though now that I look at it, that sets the endDate, not startDate. So I'm still not sure how startDate is set.

Last edited by ShankedS; 07-27-2018 at 12:35 PM.
Reply With Quote
  #11  
Old 07-27-2018, 08:30 AM
NoSparks NoSparks is offline Auto Populate Sheets? Windows 7 64bit Auto Populate Sheets? Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

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 ?
Reply With Quote
  #12  
Old 07-27-2018, 08:44 AM
ShankedS ShankedS is offline Auto Populate Sheets? Windows 10 Auto Populate Sheets? Office v. X
Advanced Beginner
Auto Populate Sheets?
 
Join Date: Oct 2014
Posts: 62
ShankedS is on a distinguished road
Default

@NoSparks

The first would be correct

Last edited by ShankedS; 07-27-2018 at 12:36 PM.
Reply With Quote
  #13  
Old 07-27-2018, 09:09 AM
NoSparks NoSparks is offline Auto Populate Sheets? Windows 7 64bit Auto Populate Sheets? Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

This should do it

When replying, just click Post Reply button instead of Quote button.
Attached Files
File Type: xlsm new-Timesheet-2019_v3.xlsm (26.5 KB, 9 views)
Reply With Quote
  #14  
Old 07-27-2018, 09:24 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Auto Populate Sheets? Windows 7 64bit Auto Populate Sheets? Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,779
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

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.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Populate Sheets? 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 Sheets? Auto-populate?? Futsal1st Word 1 05-23-2014 03:03 AM
Auto Populate Sheets? auto cell populate 2 Stevejd58 Excel 3 08-20-2013 04:23 PM
Auto Populate Sheets? 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

Other Forums: Access Forums

All times are GMT -7. The time now is 05:42 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft