PC Review


Reply
Thread Tools Rate Thread

Create Workbooks and then create Worksheets within them

 
 
K
Guest
Posts: n/a
 
      23rd Jul 2009
A B C …..col
CC 22 JIM
SS 33 JIM
VV 34 TIM
AA 45 TIM
XX 77 KIM
MM 88 KIM


I have above data in sheet and I need macro which should do things
(see below)
1 - Looking at column C values in above data, macro should create
workbooks according to the numbers of one dublicate value (for above
data it will be 3 workbooks) and name them "JIM" , "TIM" and "KIM".
2 - Then looking at column A values in above data macro should create
2 worksheets in workbook "JIM" and name them "CC" and "SS" as in above
data in column C where the value is "JIM" in same row of column A it
has the value "CC" and "SS".
3 - In cell A1 of sheets "CC" and "SS" put the value which appear in
column B. (which will be 22 for worksheet "CC" and 33 for worksheet
"SS")
4 - Repeat no. 2 and 3 for workbook "TIM" and "KIM".


In other words macro should produce below result
1 - Workbook("JIM") with Worksheets("CC") & Worksheets("SS") and in
Worksheets("CC").Range("A1").Value = 22 and Worksheets("SS").Range
("A1").value = 33
2 - Workbook("TIM") with Worksheets("VV") & Worksheets("AA") and in
Worksheets("VV").Range("A1").Value = 34 and Worksheets("AA").Range
("A1").value = 45
3 - Workbook("KIM") with Worksheets("XX") & Worksheets("MM") and in
Worksheets("XX").Range("A1").Value = 77 and Worksheets("MM").Range
("A1").value = 88

I'll be very greateful if any friend can help.
 
Reply With Quote
 
 
 
 
ryguy7272
Guest
Posts: n/a
 
      23rd Jul 2009
Seems like a tall order. Let's start with something relatively easy, and go
from there. Take a look at this link:
http://www.rondebruin.nl/copy5.htm

The code loops through a range (or your choosing) and copies records with
the same value in a column to a new sheet or workbook. Start with that and
post back with your progress.

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"K" wrote:

> A B C …..col
> CC 22 JIM
> SS 33 JIM
> VV 34 TIM
> AA 45 TIM
> XX 77 KIM
> MM 88 KIM
>
>
> I have above data in sheet and I need macro which should do things
> (see below)
> 1 - Looking at column C values in above data, macro should create
> workbooks according to the numbers of one dublicate value (for above
> data it will be 3 workbooks) and name them "JIM" , "TIM" and "KIM".
> 2 - Then looking at column A values in above data macro should create
> 2 worksheets in workbook "JIM" and name them "CC" and "SS" as in above
> data in column C where the value is "JIM" in same row of column A it
> has the value "CC" and "SS".
> 3 - In cell A1 of sheets "CC" and "SS" put the value which appear in
> column B. (which will be 22 for worksheet "CC" and 33 for worksheet
> "SS")
> 4 - Repeat no. 2 and 3 for workbook "TIM" and "KIM".
>
>
> In other words macro should produce below result
> 1 - Workbook("JIM") with Worksheets("CC") & Worksheets("SS") and in
> Worksheets("CC").Range("A1").Value = 22 and Worksheets("SS").Range
> ("A1").value = 33
> 2 - Workbook("TIM") with Worksheets("VV") & Worksheets("AA") and in
> Worksheets("VV").Range("A1").Value = 34 and Worksheets("AA").Range
> ("A1").value = 45
> 3 - Workbook("KIM") with Worksheets("XX") & Worksheets("MM") and in
> Worksheets("XX").Range("A1").Value = 77 and Worksheets("MM").Range
> ("A1").value = 88
>
> I'll be very greateful if any friend can help.
>

 
Reply With Quote
 
Patrick Molloy
Guest
Posts: n/a
 
      27th Jul 2009
use the advanced filter to extract unique values from column C, so say
column K

then you can create the workbooks by reading down column K and add sheets
easily by reading down column A adding the sheets to the relevent workbooks

coding this is simplistic, if you need help - reply and ask




"ryguy7272" <(E-Mail Removed)> wrote in message
news:F247086C-9D8B-47DE-A1D6-(E-Mail Removed)...
> Seems like a tall order. Let's start with something relatively easy, and
> go
> from there. Take a look at this link:
> http://www.rondebruin.nl/copy5.htm
>
> The code loops through a range (or your choosing) and copies records with
> the same value in a column to a new sheet or workbook. Start with that
> and
> post back with your progress.
>
> HTH,
> Ryan---
>
> --
> Ryan---
> If this information was helpful, please indicate this by clicking ''Yes''.
>
>
> "K" wrote:
>
>> A B C …..col
>> CC 22 JIM
>> SS 33 JIM
>> VV 34 TIM
>> AA 45 TIM
>> XX 77 KIM
>> MM 88 KIM
>>
>>
>> I have above data in sheet and I need macro which should do things
>> (see below)
>> 1 - Looking at column C values in above data, macro should create
>> workbooks according to the numbers of one dublicate value (for above
>> data it will be 3 workbooks) and name them "JIM" , "TIM" and "KIM".
>> 2 - Then looking at column A values in above data macro should create
>> 2 worksheets in workbook "JIM" and name them "CC" and "SS" as in above
>> data in column C where the value is "JIM" in same row of column A it
>> has the value "CC" and "SS".
>> 3 - In cell A1 of sheets "CC" and "SS" put the value which appear in
>> column B. (which will be 22 for worksheet "CC" and 33 for worksheet
>> "SS")
>> 4 - Repeat no. 2 and 3 for workbook "TIM" and "KIM".
>>
>>
>> In other words macro should produce below result
>> 1 - Workbook("JIM") with Worksheets("CC") & Worksheets("SS") and in
>> Worksheets("CC").Range("A1").Value = 22 and Worksheets("SS").Range
>> ("A1").value = 33
>> 2 - Workbook("TIM") with Worksheets("VV") & Worksheets("AA") and in
>> Worksheets("VV").Range("A1").Value = 34 and Worksheets("AA").Range
>> ("A1").value = 45
>> 3 - Workbook("KIM") with Worksheets("XX") & Worksheets("MM") and in
>> Worksheets("XX").Range("A1").Value = 77 and Worksheets("MM").Range
>> ("A1").value = 88
>>
>> I'll be very greateful if any friend can help.
>>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Workbooks and Copy Template Worksheet to those Workbooks K Microsoft Excel Programming 13 26th Jul 2009 09:29 AM
Macro to Create Workbooks & Worksheets Ciara Microsoft Excel Programming 0 28th Feb 2007 01:22 PM
Auto Create workbooks and worksheets per columnar data =?Utf-8?B?Um9va2llX1VzZXI=?= Microsoft Excel Programming 7 31st Jul 2006 09:25 PM
Create workbooks from worksheets =?Utf-8?B?SWFuIGluIEFua2FyYQ==?= Microsoft Excel Misc 3 28th Feb 2006 03:33 PM
Create dynamic link to multiple worksheets/workbooks =?Utf-8?B?R2VycnkgYXQgTWF4eA==?= Microsoft Excel Worksheet Functions 1 28th Sep 2004 04:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:38 AM.