+ Reply to Thread
Results 1 to 6 of 6

Copy data against each checked check box and paste in a new excel workbook

  1. #1
    Registered User
    Join Date
    06-25-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    3

    Copy data against each checked check box and paste in a new excel workbook

    Hello everyone,
    Newbie at VBA coding.

    I am trying to write a code which will allow me to do 2 things:
    1) Copy paste a blank form in a new workbook for every checked check box
    2) In this newly created blank form i want to paste the "Name" field which will be picked up from the base sheet

    Pl find attached excel sheet with the code I have managed till now. I have written code for one checkbox as I do not know how to write code for loop.
    Sheet 1 - Base sheet with info about name
    Sheet 2 - Blank format with name field blank

    * I am continuously getting error Method paste of object failed.
    Your help will be highly appreciated.
    Attached Files Attached Files
    Last edited by rnd; 06-28-2010 at 05:40 AM.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Copy data against each checked check box and paste in a new excel workbook

    Hi rnd
    Welcome to the forum.
    I'd use the "linked Cell" value to work out which value to copy to new work book

    then modify something like
    Please Login or Register  to view this content.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    06-25-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Copy data against each checked check box and paste in a new excel workbook

    Thanks Pike.

    I tried pasting the code you suggested but it seems I am not doing it right.
    Can you pl explain as to where do i put the code you suggested.

    I am getting run time error 1004.

  4. #4
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Copy data against each checked check box and paste in a new excel workbook

    Hi rnd

    for each of the checkboxes set the propeties "Linked Cell"
    Checkbox1 linked cell = D3
    Checkbox2 linked cell = D4
    Checkbox3 linked cell = D5.....etc

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-25-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    3

    Thumbs up Re: Copy data against each checked check box and paste in a new excel workbook

    Pike thanks a ton.
    Works BEAUTIFULLY

    I was struggling with this problem for a week now. I should have come to this forum earlier

    Thanks a lot.

  6. #6
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Copy data against each checked check box and paste in a new excel workbook

    no problems rnd
    thanks for posting

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1