Adding custom made buttons

tholamew

New Member
Joined
Jan 20, 2005
Messages
6
Guys-

I just joined the forum yesterday, but have already had very helpful feedback. This place rocks thanks to some of you geniuses out there.

Here's a new question: How can I add a custom made button (or two) to replace the +/- button for collapsing groups?
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Code:
Private Sub CommandButton1_Click()
Dim ws As Worksheet
Set ws = ActiveSheet

ws.Outline.ShowLevels (1)
End Sub

This code will allow you to set the outline level. Just chagne the ShowLevels(1) to 2, or 3....

HTH
Cal
 
Upvote 0
Cal-

Sorry, I didn't understand one of the terms you used: "outline levels". What are the "outline levels"? I tried adding the code that you gave, and checked to see how it changed my outlines, but didn't notice any change. I then tried to change the (1) to a (2) and (3), but still didn't see a change.

Any suggestions?
 
Upvote 0
tholamew,

I was assuming that the plus and minus's you were referring to were the ones added to the left side of the workbook, when you add sub totals.(They allow you to summarize the data at a higher level) Let me know if that's not what you were talking about.


Cal
 
Upvote 0
Cal-

Yeah, I was referring to the plus and minuses added to the left side of the workbook (I added them by going to the "Data" menu, and then to Group & Outline). So, it looks like we're talking about the same thing. I got confused when I saw your code, because I didn't see where it asked for the custom graphics to replace the ugly plus and minus buttons. But, beyond that, I tried inserting the code anyway just to see what it does, and I didn't see any change.

Any comments?
 
Upvote 0
tholamew

As far as I know you can't replace these default +/- buttons.

The code Cal provided would work if you added a command button from either the Forms or Control Toolbox toolbars.
 
Upvote 0
Norie,
Missed that one entirely, I replaced them, as in you don't need to use them, not as in make them look pretty. :biggrin:
 
Upvote 0
Cal

So did I at first.

Mind you I know I said it wasn't possible but perhaps there is some way.

I imagine it might involve using the API.
 
Upvote 0
I don't know about you, but that would be messing with a level Excel, that I sure as heck wouldn't want to be messing with. :eek: :biggrin: It might not be exactly perfect right now, but I'm sure my input with it wouldn't be an improvement. :LOL:
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,251
Members
448,556
Latest member
peterhess2002

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top