Macro copy

P

puiuluipui

Hi, i need a macro to copy some informations from "workbook day" to "workbook
db". The macro to copy informations only to sheets that match but to keep
what informations was already in "workbook db". And i need to add between old
informations and today informations (between days), a row with today's date.
Every day i have some informations that i need to add to "workbook db" so i
can have a database with all the days in a month. But i have many sheets, so
i can't just copy/paste.
Can this be done?
Thanks!
 
J

Joel

I need some more details.

1) When you talk about multiple worksheet I'm thinking you mean that you
have a workbook with one sheet for each day of the month? Or do you have
sheets in each workbook with different type data.
2) What column is the date in each worksheet?
3) If the sheet doesn't exist do you want to copy the worksheet from
"workbook day" completely into a new sheet in "workbook db".
4) If you have one worksheet per month to you want to just copy the data to
the last row of the worksheet?
 
P

puiuluipui

Hi, "workbook db" have names sheets (now i have 20). "Workbook day" it's
identical, but not necessarily 20 sheets.
Everyday i make a long table with many entries. each entry belongs to some
other name. I filter with a macro this table so the result is an workbook
with names sheets. Each sheet contain corespondent entry for each name. EX:
sheet John has 18 rows with etries, sheet Mary has 32 rows with entry...etc.

Ex: workbook day:
sheet john - 18 rows with information from this day (04.09.2009)
sheet mary - 32 rows with information from this day (04.09.2009)
.....

Ex: workbook db:
sheet john - rows with information from day (01.09.2009)
rows with information from day (02.09.2009)
rows with information from day (03.09.2009)
sheet mary - rows with information from this day (01.09.2009)
rows with information from this day (02.09.2009)
rows with information from this day (03.09.2009)
.....

I need to add information from this day (04.09.2009) from john to john; from
mary to mary......Workbook day contain today information, workbook db contain
information from the begining of the month, and at the end of each day to add
today to db.

Each sheet represent a name and contain informations for everyday.
Ex: John sheet- informations from 01.09.2009.....04.09.2009....30.09.2009.

Date problem. I don't have a column for date. After i copy from john to
john, i need the macro to add date to next row.
Like your 4 question:
4) If you have one worksheet per month to you want to just copy the data to
the last row of the worksheet?
YES, like this :
Ex: to john
rows with informations
01.09.2009
rows with informations
02.09.2009
rows with informations
03.09.2009........

3) If the sheet doesn't exist do you want to copy the worksheet from
"workbook day" completely into a new sheet in "workbook db".
YES. it's a great ideea. I like this ideea.

Sory i didn't explain more easily.
I can send you an email with the workbooks.

Thanks for you help!











"Joel" a scris:
 
P

puiuluipui

Hi, if it's easy for you...the macro to Copy data to various sheets based on
the value in column G

From the table i make every day, the macro to extract rows based on the name
in column G.
If the row have in G column "john, then to copy that row to workbook db in
john's sheet.
Ex: everyday table
a b c d e f g
1 info info info info info john
2 info info info info info mary
3 info info info info info john
4 info info info info info mary

The macro to copy rows that have john in "G" column, to "workbook db" in
"john" sheet
The macro to copy rows that have mary in "G" column, to "workbook db" in
"mary" sheet
........

This would be easier for me. I hope is for you too.

Thanks!




"Joel" a scris:
 
J

Joel

Having a single sheet in the "workbook day" is the easiest way to go. I
will sort the sheet by column g at the beginning of the macro. I will skip
the header row on this sheet.

I have more equestion. Can you put the date into the "workbook day" sheet.
You don't want to put the data at the end of the sheet so I assume there is
various dates that you are adding to this sheet.

I need to identify on the "workbook db" which rows contain the dates. I can
do one of two things
a) Have the dates in column A and the data start in column B
b) Have the dates and data start in column A. The rows with dates will
have
nothing in column B.

I assume the sheet will have the dates in order ascending
 
P

puiuluipui

This is how workbook day looks like:

a b c d e f g
1 nr mag com adr id hr name
2
3 1 slg 11456 b 114 11:05 john
4 2 crf 0245 b 987 11:06 mary
5 3 met 0992 b 02 12:21 jim
6 4 slg 11457 b 114 12:54 john


This is how workbook db i would like to be:
sheet john:

a b c d e f g
1 nr mag com adr id hr name
2 01.09.2009
3 1 slg 11456 b 114 11:05 john
4 4 slg 11457 b 114 12:54 john
5 02.09.2009
6 1 slb 11478 b 114 10:19 john
7 03.09.2009

Each day the "workbook day" would be different. today is 01.09.2009, so all
the datas in "workbook day" would be the datas for this day. I will run your
macro and the macro to copy rows with john in "g" and paste the rows in
"workbook db" in sheet "john", and in front of the rows to put today's date.
the code to write 01.09.2009 and below to paste the rows. tomorow will be
02.09.2009, so in "workbook day" i will have other datas, so i will run your
code again and the code to write 02.09.2009 to john's sheet and after this to
paste rows with john in "G"

And the code to do the same with all the sheets and names in "G".

I could send an email with workbooks. it's easier to understand what i need.
I can't explain like i wish.
I hope you can understand.

I can put today date in "A"column , so all the entries in today's "workbook
day" will begin with today date (01.09.2009). All the entries in tomorow's
"workbook day" will begin with tomorow's date (02.09.2009).....so the macro
to just copy the rows with a name in "G" and paste them to the corespondant
namesheet in "workbook db". It's ok?

Thanks!




"Joel" a scris:
 
P

puiuluipui

Hi Joel, in A column i will put the date (01.09.2009....) and the data start
in B column. The sheet will have the dates in ascending order. Sorry for my
prior post. I was on the rush
Have a nice day.
Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top