MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Apr 11th, 2002, 11:20 AM   #1
Anne Troy
MrExcel MVP
 
Anne Troy's Avatar
 
Join Date: Feb 2002
Location: Allentown, PA
Posts: 2,510
Default

Hello, everybody.

Input Workseet:

Col A: Date
Col B through M: Headings are employee names, data is how many hours of vacation per DATE.

User will enter a date in column A, and then the corresponding number of vacation hours a person took that day. There are a dozen or so employees, so we're only entering a record on the dates that someone has taken vacation time. Dates are mm/dd/yyyy format. The hours are number/two decimals.

What I would like:

An update command button (hey, I can actually do that part!) that has an on-click that:

Loops through each column B through M, and copies the information to the employee's individual sheet.

The individual sheets:

Columns are:
A = Date of vacation
B through M are months Jan through Dec.

Data starts *paste* in cell A12, where the date of the first vacation day they take should appear. If it was a half-day in February, .5 (or .50) will appear in cell A14.

If it's not clear, I'm happy to send the file! If you put your email here, I'll send it right away. If you email me at home, it'll be a few hours before I can send.

No rush on my part.

Really appreciate it!! I'm not a coder. I know small bits and pieces. When you start talking about Dim, I think of chinese food.

_________________
TheWordExpert

[ This Message was edited by: Dreamboat on 2002-04-11 10:20 ]
Anne Troy is offline   Reply With Quote
Old Apr 11th, 2002, 11:32 AM   #2
lantiger
New Member
 
Join Date: Apr 2002
Posts: 24
Default

Hey Dreamboat:
It does seems somewhat unclear about where you want to "paste" the data to, if nobody give you a good answer, you can send me your code to my email (see below), I will take a look at it this weekend.

lantiger
lantiger@hotmail.com
lantiger is offline   Reply With Quote
Old Apr 11th, 2002, 11:34 AM   #3
Anne Troy
MrExcel MVP
 
Anne Troy's Avatar
 
Join Date: Feb 2002
Location: Allentown, PA
Posts: 2,510
Default

Sorry. I repeat.

I'm not a coder.

I have no code.

_________________
TheWordExpert

[ This Message was edited by: Dreamboat on 2002-04-11 10:34 ]
Anne Troy is offline   Reply With Quote
Old Apr 11th, 2002, 11:37 AM   #4
lantiger
New Member
 
Join Date: Apr 2002
Posts: 24
Default

sorry on my part for not refer it correctly. I meant file.

lantiger
lantiger is offline   Reply With Quote
Old Apr 11th, 2002, 11:43 AM   #5
Anne Troy
MrExcel MVP
 
Anne Troy's Avatar
 
Join Date: Feb 2002
Location: Allentown, PA
Posts: 2,510
Default

Oh! Okay! Thanks!!

Paste to =

One Data input sheet for user to input vacation days earned, used, etc.

Each Employee has a worksheet. I would like to paste the date and how many hours vacation they took that day from the data input sheet and copy each employee-specific date/hours to the employee's specific sheet.

Sending file!!
__________________
~Anne Troy
Anne Troy is offline   Reply With Quote
Old Apr 14th, 2002, 10:28 AM   #6
Jeanie
New Member
 
Join Date: Apr 2002
Posts: 7
Default

Did you find the answer to your question because I am having a nightmare with something similar! I need a way to transfer data I entered on one page to another, but on the next row. If you did get an answer, could you reply to this one or see my message on page one. thanks!
Jeanie is offline   Reply With Quote
Old Apr 14th, 2002, 11:07 AM   #7
Jay Petrulis
MrExcel MVP
 
Jay Petrulis's Avatar
 
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
Default

Quote:
On 2002-04-14 09:28, Jeanie wrote:
Did you find the answer to your question because I am having a nightmare with something similar! I need a way to transfer data I entered on one page to another, but on the next row. If you did get an answer, could you reply to this one or see my message on page one. thanks!
Hi Jeanie,

I sent a file to Dreamboat to do what you wish, but it is at work. I think others were working on the request for her as well, but I am unsure of their results.

Please describe in more detail how your data is set up. If Data Validation (see other thread) is not enough for you, let us know what sheet your data set is on and in what order; what sheet(s) you want to populate and how; and what criteria is required for the search.

For a simple transfer, here are two options using code. The first copies the data from Sheet1 to Sheet2 (the entire row), including formulae. The second only transfers the values.

---begin VBA---
Sub test()
Dim lastrow As Long, x As Long

lastrow = Sheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row

For x = 1 To lastrow
Sheets("Sheet1").Rows(x).Copy Sheets("Sheet2").Rows(x + 1)
Next x

End Sub
''''''''''''''''''''''''''''''''
Sub test2()
Dim lastrow As Long, x As Long


lastrow = Sheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row
For x = 1 To lastrow
Sheets("Sheet1").Rows(x).Copy
Sheets("Sheet2").Rows(x + 1).PasteSpecial (xlValues)
Next x

End Sub
---end VBA---

Bye,
Jay
Jay Petrulis is offline   Reply With Quote
Old Apr 16th, 2002, 11:43 AM   #8
Anne Troy
MrExcel MVP
 
Anne Troy's Avatar
 
Join Date: Feb 2002
Location: Allentown, PA
Posts: 2,510
Default

Jay:

I apologize for not getting back to you sooner; it couldn't be helped!

THANK YOU SOOOO MUCH.

Your work is EXCELLENT. I sure hope you do this for money! It's a beautiful thing.
__________________
~Anne Troy
Anne Troy is offline   Reply With Quote
Old Apr 16th, 2002, 12:05 PM   #9
Cosmos75
Board Regular
 
Join Date: Feb 2002
Location: Tulsa, OK
Posts: 354
Default

I have a Worksheet with names (Column A) and info/values to the right (Columns B to E).

Each names appears more than once.

Is there a macro that can copy each persons’ info to a auto-generated sheet named after the person?
Cosmos75 is offline   Reply With Quote
Old Apr 16th, 2002, 01:26 PM   #10
Jay Petrulis
MrExcel MVP
 
Jay Petrulis's Avatar
 
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
Default

Quote:
On 2002-04-16 11:05, Cosmos75 wrote:
I have a Worksheet with names (Column A) and info/values to the right (Columns B to E).

Each names appears more than once.

Is there a macro that can copy each persons’ info to a auto-generated sheet named after the person?
Hi,

Short answer:

1. Get a list of unique names and add a sheet, then name it the person's name

a) advanced filter and cycle through the list

b) loop through the list of names and determine whether the sheet exists or not. If it does, go on, else add the sheet.

2. Cycle through the data list and add each item to the appropriate sheet. You will match the name in the cell and transfer the data to the relevant sheet.

These two can/should be separate routines as you will only have to add sheets initially and/or when new people are added.

Here is a function (adapted from John W. Power Programming book) which can be called to determine if a sheet exists or not.

--------------------
Public Function SheetExists(sheetname) As Boolean
Dim abc As Object
On Error Resume Next
Set abc = ActiveWorkbook.Sheets(sheetname)
If Err = 0 Then SheetExists = True _
Else SheetExists = False
End Function
--------------------

This should get you started.

HTH,
Jay
Jay Petrulis is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 10:20 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes