NicholasP
Active Member
- Joined
- Nov 18, 2006
- Messages
- 289
Hi,
I'm trying to use VB to add a button in Excel. I've been playing around with this for the better part of the day, and I can't seem to figure it out.
So far, this is what I have:
The problem is, this doesn't work (although it was working when I had it in the test file, so I'm not sure what I changed to make this not work).
If anyone has any suggestions, I'd be very grateful! Also, any links that anyone might think are useful for dealing with this topic would be much appreciated as well.
Thanks
Nick
I'm trying to use VB to add a button in Excel. I've been playing around with this for the better part of the day, and I can't seem to figure it out.
So far, this is what I have:
Code:
x = ActiveWorkbook.Name
ActiveSheet.Buttons.Add(700, 15, 100, 37.5).Select
Selection.OnAction = x & "!ShowSheets"
Selection.Characters.Text = "Show Calculation Sheets"
ActiveSheet.Buttons.Add(700, 68, 100, 37.5).Select
With Selection
.OnAction = x & "!HideSheets"
.Characters.Text = "Hide Calculation Sheets"
End With
The problem is, this doesn't work (although it was working when I had it in the test file, so I'm not sure what I changed to make this not work).
If anyone has any suggestions, I'd be very grateful! Also, any links that anyone might think are useful for dealing with this topic would be much appreciated as well.
Thanks
Nick