Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Drop Down and Auto Insert

I have a payroll form where I would like to have a drop down for PayPeriod of
1-26 for all weeks in the year.

After selecting the current pay period between 1 and 26 I would like Excel
to automatically insert the Beginning Report Date in one cell and the through
date in another cell.

For instance if 01 is selected the two cells would be 12/25/05 and 01/07/06.

I then have all the days for the two weeks in rows going down the form with
the day of the week and the date next to it.

I have the spreadsheet working now such that I can enter the pay period I
want to enter manual and it fills the cells all the way through. I am trying
to add the feature to be able to select the pay period from a driop down list
rather than manually enter.

What kind of macro or thing would I need to do to create the drop down
feature? I have created Names for Reportdate and Through which have the
corresponding 26 dates each would have as a start since I think this would be
needed if a macro is used.
--
Brian
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Drop Down and Auto Insert

This can be done without any code. On a seperate sheet in the workbook add
the numbers 1-26 in column A. In B and C add the appropriate end dates for
tose periods. My preference would be to use named ranges for something like
this. Name the Range A1:A26 PayPeriodList and the range A1:C26 PayPeriodDates.

Now on the sheet you intend to use in the cell where you want the drop down
add a validation list (Data-Validation-List =PayPeriodList). In the cells
where you want the dates add a lookup formula =Vlookup(A2, PayPeriodDates, 2,
false)... where A2 is the pay period number that you got from the drop down
list.
--
HTH...

Jim Thomlinson


"bdehning" wrote:

I have a payroll form where I would like to have a drop down for PayPeriod of
1-26 for all weeks in the year.

After selecting the current pay period between 1 and 26 I would like Excel
to automatically insert the Beginning Report Date in one cell and the through
date in another cell.

For instance if 01 is selected the two cells would be 12/25/05 and 01/07/06.

I then have all the days for the two weeks in rows going down the form with
the day of the week and the date next to it.

I have the spreadsheet working now such that I can enter the pay period I
want to enter manual and it fills the cells all the way through. I am trying
to add the feature to be able to select the pay period from a driop down list
rather than manually enter.

What kind of macro or thing would I need to do to create the drop down
feature? I have created Names for Reportdate and Through which have the
corresponding 26 dates each would have as a start since I think this would be
needed if a macro is used.
--
Brian

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default Drop Down and Auto Insert

You don't need a macro to have dropdown functionality in a cell. This
can be done with data validation. See excel help and Debra Dalgleish's
notes at:
http://www.contextures.com/xlDataVal01.html

Hope this helps
Rowan

bdehning wrote:
I have a payroll form where I would like to have a drop down for PayPeriod of
1-26 for all weeks in the year.

After selecting the current pay period between 1 and 26 I would like Excel
to automatically insert the Beginning Report Date in one cell and the through
date in another cell.

For instance if 01 is selected the two cells would be 12/25/05 and 01/07/06.

I then have all the days for the two weeks in rows going down the form with
the day of the week and the date next to it.

I have the spreadsheet working now such that I can enter the pay period I
want to enter manual and it fills the cells all the way through. I am trying
to add the feature to be able to select the pay period from a driop down list
rather than manually enter.

What kind of macro or thing would I need to do to create the drop down
feature? I have created Names for Reportdate and Through which have the
corresponding 26 dates each would have as a start since I think this would be
needed if a macro is used.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need VBA script to auto-insert value upon row insert Phil Excel Worksheet Functions 4 May 6th 08 02:41 PM
Drop down lists that auto create and then filter the next drop down list [email protected] Excel Worksheet Functions 2 September 30th 07 11:53 AM
Using a drop-down list along with an auto-populate drop-down CrazyLostConfused Excel Discussion (Misc queries) 1 April 17th 07 12:10 AM
Can I auto insert a worksheet when I insert a value in a cell. iainc Excel Worksheet Functions 0 April 27th 06 08:37 AM
Insert cell/format/text/fontsize and auto insert into header? Unfurltheflag Excel Programming 2 November 3rd 04 05:39 PM


All times are GMT +1. The time now is 11:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"