PC Review


Reply
Thread Tools Rate Thread

Copying select data frm one workbook to multiple workbooks & save

 
 
=?Utf-8?B?UG1hbg==?=
Guest
Posts: n/a
 
      19th Sep 2007
Hi,

I'm new to VBA coding, so I usually record macros.
I need help on a macro for copying select data from a master-file, and
pasting them into a separate worksheet and save that worksheet. I have
included a screenshot of the data I'm working with currently.

Screenshot of current data:

http://tinypic.com/view.php?pic=2u6h2kh&s=1

You'll see that column A has the names of multiple products. I'd like help
on a Macro that copies the rows for a particular product, pastes it into a
new worksheet and saves it in a folder in my documents. (Also have to copy
the first 8 rows in this master file which contains the headers).

Please help me out as I have to do this every month and there are close to
800 product names in there which keep on varying....so their location is
never fixed. I tried recording a macro by doing it manually, however it was
useless the next month when the data for the product names varied (resulting
in an increase/ decrease in # of rows, leading to wrong data being copied).

Thanks, and GOD bless.

Pman
 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      19th Sep 2007
Start here
http://www.rondebruin.nl/copy5.htm

Use the workbook example
http://www.rondebruin.nl/copy5.htm#workbook


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Pman" <(E-Mail Removed)> wrote in message news:BD4E473F-4191-4852-A195-(E-Mail Removed)...
> Hi,
>
> I'm new to VBA coding, so I usually record macros.
> I need help on a macro for copying select data from a master-file, and
> pasting them into a separate worksheet and save that worksheet. I have
> included a screenshot of the data I'm working with currently.
>
> Screenshot of current data:
>
> http://tinypic.com/view.php?pic=2u6h2kh&s=1
>
> You'll see that column A has the names of multiple products. I'd like help
> on a Macro that copies the rows for a particular product, pastes it into a
> new worksheet and saves it in a folder in my documents. (Also have to copy
> the first 8 rows in this master file which contains the headers).
>
> Please help me out as I have to do this every month and there are close to
> 800 product names in there which keep on varying....so their location is
> never fixed. I tried recording a macro by doing it manually, however it was
> useless the next month when the data for the product names varied (resulting
> in an increase/ decrease in # of rows, leading to wrong data being copied).
>
> Thanks, and GOD bless.
>
> Pman

 
Reply With Quote
 
=?Utf-8?B?UG1hbg==?=
Guest
Posts: n/a
 
      20th Sep 2007
Thanks Ron, looks complicated since I'm new to coding (though I know it must
be a simple solution).....leme try it out.

P

"Ron de Bruin" wrote:

> Start here
> http://www.rondebruin.nl/copy5.htm
>
> Use the workbook example
> http://www.rondebruin.nl/copy5.htm#workbook
>
>
> --
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
> "Pman" <(E-Mail Removed)> wrote in message news:BD4E473F-4191-4852-A195-(E-Mail Removed)...
> > Hi,
> >
> > I'm new to VBA coding, so I usually record macros.
> > I need help on a macro for copying select data from a master-file, and
> > pasting them into a separate worksheet and save that worksheet. I have
> > included a screenshot of the data I'm working with currently.
> >
> > Screenshot of current data:
> >
> > http://tinypic.com/view.php?pic=2u6h2kh&s=1
> >
> > You'll see that column A has the names of multiple products. I'd like help
> > on a Macro that copies the rows for a particular product, pastes it into a
> > new worksheet and saves it in a folder in my documents. (Also have to copy
> > the first 8 rows in this master file which contains the headers).
> >
> > Please help me out as I have to do this every month and there are close to
> > 800 product names in there which keep on varying....so their location is
> > never fixed. I tried recording a macro by doing it manually, however it was
> > useless the next month when the data for the product names varied (resulting
> > in an increase/ decrease in # of rows, leading to wrong data being copied).
> >
> > Thanks, and GOD bless.
> >
> > Pman

>

 
Reply With Quote
 
=?Utf-8?B?UG1hbg==?=
Guest
Posts: n/a
 
      28th Sep 2007
Thanks Ron, the copying to multiple workbooks worked like a charm.....but I'm
getting an error message in the "create a new sheet for all unique values"
macro.
I get a Runtime error '91', which says "Object Variable or with block
variable not set" and highlights the following code
" With ws2
rng.Columns(FieldNum).AdvancedFilter _
Action:=xlFilterCopy, _
CopyToRange:=.Range("A1"), Unique:=True"

I have 25 columns and I have defined the range as you have suggested by way
of comments. Could you let me know what I'm doing wrong?

Thanks Again

"Ron de Bruin" wrote:

> Start here
> http://www.rondebruin.nl/copy5.htm
>
> Use the workbook example
> http://www.rondebruin.nl/copy5.htm#workbook
>
>
> --
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
> "Pman" <(E-Mail Removed)> wrote in message news:BD4E473F-4191-4852-A195-(E-Mail Removed)...
> > Hi,
> >
> > I'm new to VBA coding, so I usually record macros.
> > I need help on a macro for copying select data from a master-file, and
> > pasting them into a separate worksheet and save that worksheet. I have
> > included a screenshot of the data I'm working with currently.
> >
> > Screenshot of current data:
> >
> > http://tinypic.com/view.php?pic=2u6h2kh&s=1
> >
> > You'll see that column A has the names of multiple products. I'd like help
> > on a Macro that copies the rows for a particular product, pastes it into a
> > new worksheet and saves it in a folder in my documents. (Also have to copy
> > the first 8 rows in this master file which contains the headers).
> >
> > Please help me out as I have to do this every month and there are close to
> > 800 product names in there which keep on varying....so their location is
> > never fixed. I tried recording a macro by doing it manually, however it was
> > useless the next month when the data for the product names varied (resulting
> > in an increase/ decrease in # of rows, leading to wrong data being copied).
> >
> > Thanks, and GOD bless.
> >
> > Pman

>

 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      28th Sep 2007
Hi Pman

Diffecult for me without seeing the workbook
Send me the workbook private then I look at it

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Pman" <(E-Mail Removed)> wrote in message news:CDCF229B-DFBA-4F4D-9735-(E-Mail Removed)...
> Thanks Ron, the copying to multiple workbooks worked like a charm.....but I'm
> getting an error message in the "create a new sheet for all unique values"
> macro.
> I get a Runtime error '91', which says "Object Variable or with block
> variable not set" and highlights the following code
> " With ws2
> rng.Columns(FieldNum).AdvancedFilter _
> Action:=xlFilterCopy, _
> CopyToRange:=.Range("A1"), Unique:=True"
>
> I have 25 columns and I have defined the range as you have suggested by way
> of comments. Could you let me know what I'm doing wrong?
>
> Thanks Again
>
> "Ron de Bruin" wrote:
>
>> Start here
>> http://www.rondebruin.nl/copy5.htm
>>
>> Use the workbook example
>> http://www.rondebruin.nl/copy5.htm#workbook
>>
>>
>> --
>>
>> Regards Ron de Bruin
>> http://www.rondebruin.nl/tips.htm
>>
>>
>> "Pman" <(E-Mail Removed)> wrote in message news:BD4E473F-4191-4852-A195-(E-Mail Removed)...
>> > Hi,
>> >
>> > I'm new to VBA coding, so I usually record macros.
>> > I need help on a macro for copying select data from a master-file, and
>> > pasting them into a separate worksheet and save that worksheet. I have
>> > included a screenshot of the data I'm working with currently.
>> >
>> > Screenshot of current data:
>> >
>> > http://tinypic.com/view.php?pic=2u6h2kh&s=1
>> >
>> > You'll see that column A has the names of multiple products. I'd like help
>> > on a Macro that copies the rows for a particular product, pastes it into a
>> > new worksheet and saves it in a folder in my documents. (Also have to copy
>> > the first 8 rows in this master file which contains the headers).
>> >
>> > Please help me out as I have to do this every month and there are close to
>> > 800 product names in there which keep on varying....so their location is
>> > never fixed. I tried recording a macro by doing it manually, however it was
>> > useless the next month when the data for the product names varied (resulting
>> > in an increase/ decrease in # of rows, leading to wrong data being copied).
>> >
>> > Thanks, and GOD bless.
>> >
>> > Pman

>>

 
Reply With Quote
 
=?Utf-8?B?UG1hbg==?=
Guest
Posts: n/a
 
      29th Sep 2007
Thanks ron, but managed to work around it
I used the multiple workbooks macro

Thanks again, you are a life-saver

"Ron de Bruin" wrote:

> Hi Pman
>
> Diffecult for me without seeing the workbook
> Send me the workbook private then I look at it
>
> --
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
> "Pman" <(E-Mail Removed)> wrote in message news:CDCF229B-DFBA-4F4D-9735-(E-Mail Removed)...
> > Thanks Ron, the copying to multiple workbooks worked like a charm.....but I'm
> > getting an error message in the "create a new sheet for all unique values"
> > macro.
> > I get a Runtime error '91', which says "Object Variable or with block
> > variable not set" and highlights the following code
> > " With ws2
> > rng.Columns(FieldNum).AdvancedFilter _
> > Action:=xlFilterCopy, _
> > CopyToRange:=.Range("A1"), Unique:=True"
> >
> > I have 25 columns and I have defined the range as you have suggested by way
> > of comments. Could you let me know what I'm doing wrong?
> >
> > Thanks Again
> >
> > "Ron de Bruin" wrote:
> >
> >> Start here
> >> http://www.rondebruin.nl/copy5.htm
> >>
> >> Use the workbook example
> >> http://www.rondebruin.nl/copy5.htm#workbook
> >>
> >>
> >> --
> >>
> >> Regards Ron de Bruin
> >> http://www.rondebruin.nl/tips.htm
> >>
> >>
> >> "Pman" <(E-Mail Removed)> wrote in message news:BD4E473F-4191-4852-A195-(E-Mail Removed)...
> >> > Hi,
> >> >
> >> > I'm new to VBA coding, so I usually record macros.
> >> > I need help on a macro for copying select data from a master-file, and
> >> > pasting them into a separate worksheet and save that worksheet. I have
> >> > included a screenshot of the data I'm working with currently.
> >> >
> >> > Screenshot of current data:
> >> >
> >> > http://tinypic.com/view.php?pic=2u6h2kh&s=1
> >> >
> >> > You'll see that column A has the names of multiple products. I'd like help
> >> > on a Macro that copies the rows for a particular product, pastes it into a
> >> > new worksheet and saves it in a folder in my documents. (Also have to copy
> >> > the first 8 rows in this master file which contains the headers).
> >> >
> >> > Please help me out as I have to do this every month and there are close to
> >> > 800 product names in there which keep on varying....so their location is
> >> > never fixed. I tried recording a macro by doing it manually, however it was
> >> > useless the next month when the data for the product names varied (resulting
> >> > in an increase/ decrease in # of rows, leading to wrong data being copied).
> >> >
> >> > Thanks, and GOD bless.
> >> >
> >> > Pman
> >>

>

 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      29th Sep 2007
OK, have a nice weekend



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Pman" <(E-Mail Removed)> wrote in message news:05B5E084-078B-4DFA-941B-(E-Mail Removed)...
> Thanks ron, but managed to work around it
> I used the multiple workbooks macro
>
> Thanks again, you are a life-saver
>
> "Ron de Bruin" wrote:
>
>> Hi Pman
>>
>> Diffecult for me without seeing the workbook
>> Send me the workbook private then I look at it
>>
>> --
>>
>> Regards Ron de Bruin
>> http://www.rondebruin.nl/tips.htm
>>
>>
>> "Pman" <(E-Mail Removed)> wrote in message news:CDCF229B-DFBA-4F4D-9735-(E-Mail Removed)...
>> > Thanks Ron, the copying to multiple workbooks worked like a charm.....but I'm
>> > getting an error message in the "create a new sheet for all unique values"
>> > macro.
>> > I get a Runtime error '91', which says "Object Variable or with block
>> > variable not set" and highlights the following code
>> > " With ws2
>> > rng.Columns(FieldNum).AdvancedFilter _
>> > Action:=xlFilterCopy, _
>> > CopyToRange:=.Range("A1"), Unique:=True"
>> >
>> > I have 25 columns and I have defined the range as you have suggested by way
>> > of comments. Could you let me know what I'm doing wrong?
>> >
>> > Thanks Again
>> >
>> > "Ron de Bruin" wrote:
>> >
>> >> Start here
>> >> http://www.rondebruin.nl/copy5.htm
>> >>
>> >> Use the workbook example
>> >> http://www.rondebruin.nl/copy5.htm#workbook
>> >>
>> >>
>> >> --
>> >>
>> >> Regards Ron de Bruin
>> >> http://www.rondebruin.nl/tips.htm
>> >>
>> >>
>> >> "Pman" <(E-Mail Removed)> wrote in message news:BD4E473F-4191-4852-A195-(E-Mail Removed)...
>> >> > Hi,
>> >> >
>> >> > I'm new to VBA coding, so I usually record macros.
>> >> > I need help on a macro for copying select data from a master-file, and
>> >> > pasting them into a separate worksheet and save that worksheet. I have
>> >> > included a screenshot of the data I'm working with currently.
>> >> >
>> >> > Screenshot of current data:
>> >> >
>> >> > http://tinypic.com/view.php?pic=2u6h2kh&s=1
>> >> >
>> >> > You'll see that column A has the names of multiple products. I'd like help
>> >> > on a Macro that copies the rows for a particular product, pastes it into a
>> >> > new worksheet and saves it in a folder in my documents. (Also have to copy
>> >> > the first 8 rows in this master file which contains the headers).
>> >> >
>> >> > Please help me out as I have to do this every month and there are close to
>> >> > 800 product names in there which keep on varying....so their location is
>> >> > never fixed. I tried recording a macro by doing it manually, however it was
>> >> > useless the next month when the data for the product names varied (resulting
>> >> > in an increase/ decrease in # of rows, leading to wrong data being copied).
>> >> >
>> >> > Thanks, and GOD bless.
>> >> >
>> >> > Pman
>> >>

>>

 
Reply With Quote
 
=?Utf-8?B?UG1hbg==?=
Guest
Posts: n/a
 
      2nd Oct 2007
Thanks Ron,

I tried the worksheets code totally fresh today and it worked without a
glitch....maybe my computer had the weekend blues

Thanks for your macros page

"Ron de Bruin" wrote:

> OK, have a nice weekend
>
>

 
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
Copying data from one workbook to another dependent on user select sarahphonics Microsoft Excel Misc 1 19th Apr 2010 04:37 PM
copying a range of data multiple times from multiple workbooks sot Microsoft Excel Programming 1 23rd Nov 2009 10:21 PM
Copying dada from multiple workbooks into 1 workbook Jasonm Microsoft Excel Programming 4 16th Dec 2007 03:30 AM
Split data from 1 workbook into multiple workbooks based on criter =?Utf-8?B?YlVuY0U=?= Microsoft Excel Worksheet Functions 0 29th Oct 2007 03:26 PM
Help with Macro (copying data from multiple workbooks) =?Utf-8?B?VGltIEhhcmRpbmc=?= Microsoft Excel Misc 1 5th Feb 2005 10:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:33 AM.