ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem copying checkbox values (https://www.excelbanter.com/excel-programming/312267-problem-copying-checkbox-values.html)

marty

Problem copying checkbox values
 
Hello.

This might be a bit difficult to explain, but I'll have a
go.

I have an OLD workbook which contains 20 checkboxes and
assorted pieces of data. Checking one or more of the
checkboxes activates a macro(s) within that book.

I have a NEW version of that same workbook which contains
the same 20 checkboxes with spaces for the OLD data and
additional blank spaces for new data.

I have written a transfer utility which copies all of the
data from OLD to NEW. I want this transfer utility to
mimic the checked checkboxes from OLD to NEW as well.
(For example, if OLD boxes 1, 5 and 9 are checked in OLD,
this utility will check the corresponding 1, 5 and 9 in
NEW.)

I got the coding to work OK, but the problem is that the
checkboxes in OLD and NEW activate the code in
ActiveWorkbook.xls. When I run my utility, the utility
(not NEW) is the active workbook, and I get an error.
(NOTE: I have to use ActiveWorkbook.xls because the
workbook could be named anything.)

What is happening is that when the utility encounters the
first OLD checked box and "checks" the corresponding NEW
box, it tries to run the macro in NEW (which I would like
for it to do), but it can't, because NEW is not the
active workbook.

I realize I could put in an escape (such as a junk GoTo),
but I DO want the macro to run in NEW when the box is
checked.

Any suggestions? Let me know if it isn't clear.

Thanks,
MARTY


All times are GMT +1. The time now is 12:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com