Hi everyone!
So I have a problem that I just do not understand with one of my Macros...
I have a form to select different parts of my file to print. The thing is, over time, the numbers of rows (corresponding to added people to a list) is subject to change... My "master list" is on one sheets and I want my Macro to see, on that sheet, what's the last row in a column with a value in it, and use that row number in other sheets to decide how many rows to print. What I did (And I know the code is not optimised... but I'm a novice and as long as it works... Plus I have that code All. Over. The. Place (I tested it and it worked, so I didn't see any problem in duplicating it)... and dread a little having to COMPLETELY change it all) was that:
Now the thing is... it comes back with Error 1004... BUT sometimes, it actually does work... for example, when I just added data in the range between A1 and End(xlDown) in Sheets(2)... so i just do not know what the problem is...Please Login or Register to view this content.
So, I'll put a simplified workbook in attachement, and I'll summarize what I want my Macro to do:
1-I want it to see how many rows in column A have data on the Worksheet called "CR" (to make sure it doesn't stop at A4 or A5, I have put a white "X" in both)
2-Report that row number so it prints the selection from D1 to L"row number" on the worksheet "Février"
On a second macro:
1- Same thing
2- Same thing but for selection from N1 to V"row number" on the worksheet "Février"
etc.
In the actual workbook, there's a lot more sheets, and a lot more macros (that are, fortunately, all working properly) but I deleted them all to ligthen the file size and for it all to be clearer... (the first Sheet "Formulaire" is were the form to select which part of the document will be printed is located... the Macro called "Imprimer" is the one that decides, according to the values entered, which printing macro to call).
I'm sorry if it all seems a bit... foggy.
Hope you can help... because I "read" my macro... and to my untrained eyes, it all seems coherent...
Thank you for your help!
Bookmarks