Hi Shirley,
ToggleButtons are really shapes on the form. They really don't "tie to a cell" as I understand it. Perhaps before you CallExpandCollapse you should put the name of the button clicked in a cell on your sheet somewhere. Then when you got to the called sub you could read the cell to see what ToggleButton was pressed.
I'm imagining your code looking like:
Private Sub ToggleButton1_Click()
ActiveSheet.Range("A1") = "TB1"
Call ExpandCollapse
End Sub
Then when your get to your module code you see what is in A1 and branch based on it.
I went through the Object Browser looking for the cell a shape is attached to and found the word "ShapeRange" but couldn't make it return useful information. (I really gave me an error message which told me, once again, "you don't understand this object")
You could also declare a global variable and set it to the last button clicked and not need a cell in the workbook.
Bookmarks