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

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Cbrine

Well-known Member
Joined
Dec 2, 2003
Messages
3,196
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
 

tholamew

New Member
Joined
Jan 20, 2005
Messages
6
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?
 

Cbrine

Well-known Member
Joined
Dec 2, 2003
Messages
3,196
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
 

tholamew

New Member
Joined
Jan 20, 2005
Messages
6

ADVERTISEMENT

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?
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,282
Office Version
  1. 365
Platform
  1. Windows
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.
 

Cbrine

Well-known Member
Joined
Dec 2, 2003
Messages
3,196

ADVERTISEMENT

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:
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,282
Office Version
  1. 365
Platform
  1. Windows
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.
 

Cbrine

Well-known Member
Joined
Dec 2, 2003
Messages
3,196
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:
 

Watch MrExcel Video

Forum statistics

Threads
1,129,750
Messages
5,638,138
Members
417,010
Latest member
jnuss03

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
Top