Am a novice at VBA and appreciate advise on my problem.
I want to create multiple buttons where each button is linked to a specific table in a worksheet via VBA. When the button is clicked, it will automatically print the specified table. I have 3 tables in one worksheet. Tried to create different modules for each table to be linked to respective buttons via below code:
1. I was able to create 3 modules and attach it to respective command buttons per table. When I tried to test print, it didn't print the range I specified for the button. Was there something wrong with my code or how I attached the macro?
2. Will the above code help to maintain the formatting of range cells to be printed?
3. Any other ideas on how I can go about this would be greatly appreciated.
Attaching a sample file. Have created the VBA for all 3 tables. Thanks in advance!
I want to create multiple buttons where each button is linked to a specific table in a worksheet via VBA. When the button is clicked, it will automatically print the specified table. I have 3 tables in one worksheet. Tried to create different modules for each table to be linked to respective buttons via below code:
Code:
Sub PrintSomeCells()
Range("I1:V66").PrintOut "I changed the range on this part per macro."
End Sub
1. I was able to create 3 modules and attach it to respective command buttons per table. When I tried to test print, it didn't print the range I specified for the button. Was there something wrong with my code or how I attached the macro?
2. Will the above code help to maintain the formatting of range cells to be printed?
3. Any other ideas on how I can go about this would be greatly appreciated.
Attaching a sample file. Have created the VBA for all 3 tables. Thanks in advance!
Attachments
Last edited by a moderator: