Hello,
I need help for the following item: I have 18 customized buttons in Excel with their macros in VB6 and once I click on one of those buttons, I want to remmber this action in another button. For instance, if I click on button A, the 'variable' button will do the same action as button A each time I click on it. Now if I click on button B, the 'variable' button will do the same action as button B each time I click on it. Etc.. keep remembering the latest button (among those 18) hit and each time I click on it, repeat the same action recorded.
Below is two samples of the macros for buttons A and B:
To avoid any confusion, I want to track the name of the variable button as either the name of the latest customized button hit or the name of his previous macro.
It's tough. Thanks for your time, I would appreciate.
Regards,
Marc Dibi
I need help for the following item: I have 18 customized buttons in Excel with their macros in VB6 and once I click on one of those buttons, I want to remmber this action in another button. For instance, if I click on button A, the 'variable' button will do the same action as button A each time I click on it. Now if I click on button B, the 'variable' button will do the same action as button B each time I click on it. Etc.. keep remembering the latest button (among those 18) hit and each time I click on it, repeat the same action recorded.
Below is two samples of the macros for buttons A and B:
Code:
Sub A()
Close #5
[COLOR=green]' Open Filename For Output As 5
[/color]
Filename = Sheet7.Cells(1, 7).Text
Open Filename For Output As 5
StartRow = 26
StartCol = 14
EndRow = 65
EndCol = 24
For i = StartRow To EndRow
For j = StartCol To EndCol
Print #5, Sheet4.Cells(i, j).Text; " ";
Next j
Print #5, " "
Next i
Close #5
End Sub
Sub B()
Close #5
[COLOR=green]' Open Filename For Output As 5 [/color]
Filename = Sheet7.Cells(1, 7).Text
Open Filename For Output As 5
StartRow = 69
StartCol = 14
EndRow = 105
EndCol = 24
For i = StartRow To EndRow
For j = StartCol To EndCol
Print #5, Sheet4.Cells(i, j).Text; " ";
Next j
Print #5, " "
Next i
Close #5
End Sub
To avoid any confusion, I want to track the name of the variable button as either the name of the latest customized button hit or the name of his previous macro.
It's tough. Thanks for your time, I would appreciate.
Regards,
Marc Dibi