+ Reply to Thread
Results 1 to 6 of 6

Copy data from sheet1 to another base on the selection of Checkboxes in the userform VBA

  1. #1
    Registered User
    Join Date
    02-23-2019
    Location
    Manama, Bahrain
    MS-Off Ver
    2007
    Posts
    22

    Copy data from sheet1 to another base on the selection of Checkboxes in the userform VBA

    Dear Brothers,

    Need your kind assistance to get a solution for EXCEL VBA. I have attached the excel sheet for your kind reference.


    Want to do following through VBA:
    1- After clicking on SELECTION Button to launch a form
    from the form there the two checkbox groups Name and Day
    2- When I click on the transfer selection button on the form,
    it should transfer the realted data from sheet1 to sheet2 base on checkboxs selection
    For Example:
    If check box "ASIM" is selected from Name Group and "SAT" from Day group
    then Transfer selection button on form should copy the all the rows containing Name Asim and Day Saturday.
    Similary, Rest also…

    Your prompt assistance would highly be appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Copy data from sheet1 to another base on the selection of Checkboxes in the userform V

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-23-2019
    Location
    Manama, Bahrain
    MS-Off Ver
    2007
    Posts
    22

    Re: Copy data from sheet1 to another base on the selection of Checkboxes in the userform V

    Dear Brother Leo,

    I am grateful for your kindness to provide me such a great solution. You code is really helpful but I would request you if you could extend your kindness to revise the code in order to print the sheet2 against every matching record based on the selection of checkboxes. You use autofiler method to copy and and paste them on the other sheet which work perfectly. But the ultimate purpose of this code is to copy the selected data from sheet1 and sheet2 and then print sheet2 on the preprinted forms.

    I would appreciate if you could revise the code to adjust the following in your code which will print each record one by one from sheet1 to sheet2 and print them.

    With Sheet2
    .Range("B3").Value = Sheet1.Range("A2").Value
    .Range("B4").Value = Sheet1.Range("B2").Value
    .Range("B5").Value = Sheet1.Range("C2").Value
    .Range("B6").Value = Sheet1.Range("D2").Value
    .Range("B7").Value = Sheet1.Range("E2").Value
    .Range("B8").Value = Sheet1.Range("F2").Value
    .Range("B9").Value = Sheet1.Range("G2").Value
    .PrintOut: collate = True
    End With

    Your kindness is highly appreciated....

  4. #4
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Copy data from sheet1 to another base on the selection of Checkboxes in the userform V

    this should do the job

    Please Login or Register  to view this content.
    Kind regards
    Leo

  5. #5
    Registered User
    Join Date
    02-23-2019
    Location
    Manama, Bahrain
    MS-Off Ver
    2007
    Posts
    22

    Re: Copy data from sheet1 to another base on the selection of Checkboxes in the userform V

    Dear Brother Leo,

    Thank you so much for your prompt reply.

    I tested your code and it works perfectly but I still need to add the header of each record with the value. Would you please extend your kindness to revise the code to have the output as below on the sheet2 based on the checkbox selection.

    With Sheet2
    .Range("B3").Value = "Ref: " & Sheet1.Range("A2").Value
    .Range("B4").Value = "Name: " & Sheet1.Range("B2").Value
    .Range("B5").Value = "Section: " & Sheet1.Range("C2").Value
    .Range("B6").Value = "Day: " & Sheet1.Range("D2").Value
    .Range("B7").Value = "Class: " & Sheet1.Range("E2").Value
    .Range("B8").Value = "DCR: " & Sheet1.Range("F2").Value
    .Range("B9").Value = "APR: " & Sheet1.Range("G2").Value
    .PrintOut: collate = True
    End With

    Your favorable reply would highly be appreciated.

    Best Regards,
    Nabsher

  6. #6
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Copy data from sheet1 to another base on the selection of Checkboxes in the userform V

    Please Login or Register  to view this content.
    Kind regards
    Leo

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 03-29-2017, 10:09 AM
  2. read data from sheet1 and base on some parameters copy in other sheet
    By pedjvak in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-04-2015, 03:03 AM
  3. (Userform) if textbox has value copy data to sheet1
    By intex in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-01-2014, 08:40 PM
  4. Replies: 4
    Last Post: 12-30-2013, 10:10 AM
  5. Transfer/Copy UserForm CheckBox data to Sheet1
    By z-eighty2 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-21-2013, 06:07 PM
  6. Replies: 6
    Last Post: 11-02-2012, 11:02 AM
  7. Replies: 3
    Last Post: 06-06-2012, 05:36 AM

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