Hi sujin,
In the future, please upload a sample workbook. That way the responder does not have to reproduce your data, and you will probably get more accurate and faster responses.
if i click the necessary check box,and the command button "export the nfr", the row corresponding to the selected check box should be copied to another sheet, is there any way to add codes for that manipulation
Your question has a few issues:
a. Because you use 'Merged Cells' in Columns 'B' and 'C', the destination area will not look EXACTLY like the source area.
b. See the code in red below that creates the 'Active X' CheckBoxes (identical to the code in the link referenced above).
A 'Linked Cell' for each CheckBox as the cell underneath the CheckBox. The cell has custom formatting of 3 semi-colons [;;;] which hides the contents of the cell.
c. The CheckBox is not copied to the Destination Sheet. Please let me know if you require the Checkbox to be copied.
CheckBox Creation Code:
See the attached file which was created in Excel 2003. Active 'X' controls do not transport well between Excel versions or across state lines or International borders. I deleted all the 'Active X' CheckBoxes on 'Sheet1'. Before you use the attached file, you will have to add the 'Active X' CheckBoxes in Column 'E' using the Cyan Colored CommandButton.
The following code in Ordinary Code Module ModCopyRows:
It is a best practice to declare all variables. If you misspell a variable in your code, VBA will silently assume it is a Variant variable and go on executing with no clue to you that you have a bug. Go to the VBA development window, click Tools, Options, and check "Require Variable Declaration." This will insert the following line at the top of all new modules:
This option requires all variables to be declared and will give a compiler error for undeclared variables.
Lewis
Bookmarks