Hi
Can i use the two buttons to run test sub, and when button1 is pressed then "ark1" is used, but when button2 is pressed then i want to reference sheet "ark2".
But i want to use the same code.
So can i replace ark1 with ark2 within the code somehow.?
This is a simplified version of what im working with but this is in essence my issue. Maybe it can be done with a function or something.
VBA Code:
Option Explicit
Sub button1_click()
Call test
End Sub
Sub button2_click()
Call test
End Sub
Private Sub test()
Ark1.Range("A1").Value = "Box1"
End Sub
Can i use the two buttons to run test sub, and when button1 is pressed then "ark1" is used, but when button2 is pressed then i want to reference sheet "ark2".
But i want to use the same code.
So can i replace ark1 with ark2 within the code somehow.?
This is a simplified version of what im working with but this is in essence my issue. Maybe it can be done with a function or something.