Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Can I split&write data to each individual sheet?

Hi experts,

I have two workbooks. "All_data.xls" have 11 columns (A:K) where on column
B, I have names and on column H dates. This workbook keeps growing as we add
up new occasions.
On the other hand the other workbook "Reports.xls" have sheet names all with
the same names used (or to be used) on column B of "All_data.xls". Now I
need to be able to read data (any time) from "All_data.xls", check the names
(cell B value) and dates (cell H value) for the same line, and if both the
name and date are not written for that individual sheet (sheet with the same
name) "Reports.xls", write all the line info from "All_data.xls" to the
first available empty line of "Report.xls". Since there is no chance of
duplicates for names & dates, this way only non-repeated entried will be
written to "Report.xls".

Is it possible using macros?

Thanks in advance
Martyn





  #2   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Can I split&write data to each individual sheet?

Is it possible using macros?

Yes, it should be possible.

--
Regards,
Tom Ogilvy


"Martyn" wrote in message
...
Hi experts,

I have two workbooks. "All_data.xls" have 11 columns (A:K) where on column
B, I have names and on column H dates. This workbook keeps growing as we

add
up new occasions.
On the other hand the other workbook "Reports.xls" have sheet names all

with
the same names used (or to be used) on column B of "All_data.xls". Now I
need to be able to read data (any time) from "All_data.xls", check the

names
(cell B value) and dates (cell H value) for the same line, and if both the
name and date are not written for that individual sheet (sheet with the

same
name) "Reports.xls", write all the line info from "All_data.xls" to the
first available empty line of "Report.xls". Since there is no chance of
duplicates for names & dates, this way only non-repeated entried will be
written to "Report.xls".

Is it possible using macros?

Thanks in advance
Martyn







  #3   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Can I split&write data to each individual sheet?

Thanks for your reply Tom,
I should have clarified that I am also looking for a solution suggestion..:)
And can you/or other interested experts please suggest a VBA code that can
do the trick?
TIA
Martyn


"Tom Ogilvy" wrote in message
...
Is it possible using macros?


Yes, it should be possible.

--
Regards,
Tom Ogilvy


"Martyn" wrote in message
...
Hi experts,

I have two workbooks. "All_data.xls" have 11 columns (A:K) where on

column
B, I have names and on column H dates. This workbook keeps growing as we

add
up new occasions.
On the other hand the other workbook "Reports.xls" have sheet names all

with
the same names used (or to be used) on column B of "All_data.xls". Now I
need to be able to read data (any time) from "All_data.xls", check the

names
(cell B value) and dates (cell H value) for the same line, and if both

the
name and date are not written for that individual sheet (sheet with the

same
name) "Reports.xls", write all the line info from "All_data.xls" to the
first available empty line of "Report.xls". Since there is no chance of
duplicates for names & dates, this way only non-repeated entried will be
written to "Report.xls".

Is it possible using macros?

Thanks in advance
Martyn









  #4   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Can I split&write data to each individual sheet?

it should go something like this.

Dim bk1 as workbook, bk2 as workbook
Dim sh as worksheet, cell as range, rng as Range
Dim rng1 as Range, res as Variant
set bk1 = Workbooks("All_data.xls")
set bk2 = workbooks("Reports.xls")
set rng = bk1.Range(bk1.Cells(2,1),bk1.Cells(2,1).End(xldown ))
for each cell in rng
set sh = Bk2.Worksheets(cell.offset(0,1).value)
set rng1 = sh.Range(sh.cells(2,"H"),sh.Cells(2,"H").End(xldow n))
res = Application.Match(clng(cell.offset(0,7)),rng1,0)
if iserror(res) then
cell.Entirerow.copy
Destination:=rng1.offset(rng1.rows.count,0).Resize (1,1)
end if
Next



--
Regards,
Tom Ogilvy


"Martyn" wrote in message
...
Thanks for your reply Tom,
I should have clarified that I am also looking for a solution

suggestion..:)
And can you/or other interested experts please suggest a VBA code that can
do the trick?
TIA
Martyn


"Tom Ogilvy" wrote in message
...
Is it possible using macros?


Yes, it should be possible.

--
Regards,
Tom Ogilvy


"Martyn" wrote in message
...
Hi experts,

I have two workbooks. "All_data.xls" have 11 columns (A:K) where on

column
B, I have names and on column H dates. This workbook keeps growing as

we
add
up new occasions.
On the other hand the other workbook "Reports.xls" have sheet names

all
with
the same names used (or to be used) on column B of "All_data.xls". Now

I
need to be able to read data (any time) from "All_data.xls", check the

names
(cell B value) and dates (cell H value) for the same line, and if both

the
name and date are not written for that individual sheet (sheet with

the
same
name) "Reports.xls", write all the line info from "All_data.xls" to

the
first available empty line of "Report.xls". Since there is no chance

of
duplicates for names & dates, this way only non-repeated entried will

be
written to "Report.xls".

Is it possible using macros?

Thanks in advance
Martyn











  #5   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Can I split&write data to each individual sheet?

Hi Tom,
I used the code in the "Reports.xls" file with the All_data.xls file open
but
Received an Compile error "Invalid Outside Procedure" for the line
Set bk1 = Workbooks("All_data.xls")
Should the code reside on a seperate file?


"Tom Ogilvy" wrote in message
...
it should go something like this.

Dim bk1 as workbook, bk2 as workbook
Dim sh as worksheet, cell as range, rng as Range
Dim rng1 as Range, res as Variant
set bk1 = Workbooks("All_data.xls")
set bk2 = workbooks("Reports.xls")
set rng = bk1.Range(bk1.Cells(2,1),bk1.Cells(2,1).End(xldown ))
for each cell in rng
set sh = Bk2.Worksheets(cell.offset(0,1).value)
set rng1 = sh.Range(sh.cells(2,"H"),sh.Cells(2,"H").End(xldow n))
res = Application.Match(clng(cell.offset(0,7)),rng1,0)
if iserror(res) then
cell.Entirerow.copy
Destination:=rng1.offset(rng1.rows.count,0).Resize (1,1)
end if
Next



--
Regards,
Tom Ogilvy






  #6   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Can I split&write data to each individual sheet?

No, you need to put it in a procedu

Sub Tester1()
Dim bk1 as workbook, bk2 as workbook
Dim sh as worksheet, cell as range, rng as Range
Dim rng1 as Range, res as Variant
set bk1 = Workbooks("All_data.xls")
set bk2 = workbooks("Reports.xls")
set rng = bk1.Range(bk1.Cells(2,1),bk1.Cells(2,1).End(xldown ))
for each cell in rng
set sh = Bk2.Worksheets(cell.offset(0,1).value)
set rng1 = sh.Range(sh.cells(2,"H"),sh.Cells(2,"H").End(xldow n))
res = Application.Match(clng(cell.offset(0,7)),rng1,0)
if iserror(res) then
cell.Entirerow.copy _
Destination:=rng1.offset( _
rng1.rows.count,0).Resize(1,1)
end if
Next
End Sub

I didn't put it in a procedure because I don't want to create the impression
I bench tested it - I did not, so it may contain typos but represents an
approach. It is assumed you can fine tune it to meet your needs.

--
Regards,
Tom Ogilvy



"Martyn" wrote in message
...
Hi Tom,
I used the code in the "Reports.xls" file with the All_data.xls file open
but
Received an Compile error "Invalid Outside Procedure" for the line
Set bk1 = Workbooks("All_data.xls")
Should the code reside on a seperate file?


"Tom Ogilvy" wrote in message
...
it should go something like this.

Dim bk1 as workbook, bk2 as workbook
Dim sh as worksheet, cell as range, rng as Range
Dim rng1 as Range, res as Variant
set bk1 = Workbooks("All_data.xls")
set bk2 = workbooks("Reports.xls")
set rng = bk1.Range(bk1.Cells(2,1),bk1.Cells(2,1).End(xldown ))
for each cell in rng
set sh = Bk2.Worksheets(cell.offset(0,1).value)
set rng1 = sh.Range(sh.cells(2,"H"),sh.Cells(2,"H").End(xldow n))
res = Application.Match(clng(cell.offset(0,7)),rng1,0)
if iserror(res) then
cell.Entirerow.copy
Destination:=rng1.offset(rng1.rows.count,0).Resize (1,1)
end if
Next



--
Regards,
Tom Ogilvy






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
Split individual cells? richzip Excel Discussion (Misc queries) 2 November 5th 08 10:55 PM
How do i split data into individual cells Kelly Excel Discussion (Misc queries) 1 February 25th 08 08:50 AM
write formula that icludes data from sheet 1 to sheet 2 of my spr john Excel Worksheet Functions 1 September 14th 07 03:22 AM
Split numerical vales joinned by && into individual rows JaneBrown Excel Discussion (Misc queries) 1 November 11th 05 03:29 PM
Can I split worksheets from one workbook into individual workbooks Rosana Excel Discussion (Misc queries) 0 September 19th 05 08:03 PM


All times are GMT +1. The time now is 06:20 PM.

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

About Us

"It's about Microsoft Excel"