Written by Allen Wyatt (last updated October 25, 2021)
This tip applies to Excel 2007, 2010, and 2013
Gary uses a lot of buttons to trigger macros in his workbooks, and for some reason they move all over the place and resize themselves. He wonders why this happens and how he can stop it. He wants the buttons to stay the size he chooses, in the place he specifies.
Believe it or not, Excel allows those buttons to move and resize by default. If you don't want them to behave in that way, then you need to take steps to nail them down. If your buttons are actually form control buttons or ActiveX command buttons, then you simply need to right-click on the button and choose Format Control from the resulting Context menu. Excel displays the Format Control dialog box, on which you should select the Properties tab. (See Figure 1.)
Figure 1. The Properties tab of the Format Control dialog box.
Just click the radio button that reflects the behavior you want for the control—in most cases you'll click Don't More or Size with Cells.
If the buttons you are using are actually shapes, clip art, or a text box that you've assigned macros to, you can follow the same general steps. Right-click the object and choose Format Shape (or, if it is available, Size and Properties) from the Context menu. Excel 2007 and Excel 2010 display the Format Shape dialog box, while Excel 2013 displays the Format Shape task pane.
Set the movement and resizing radio buttons to, again, reflect the behavior you want for your object.
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (7009) applies to Microsoft Excel 2007, 2010, and 2013.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
Excel allows you to easily paste graphics into a worksheet. Once added, you may want to quickly process the graphics by ...
Discover MoreOne of the powerful programming structures available in VBA is the Select Case structure. This tip explains how you can ...
Discover MoreDoes your macro need to know how many windows Excel has open? You can determine it by using the Count property of the ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2024-11-05 09:20:25
J. Woolley
My most recent comment below was directed at Ruth Engle in response to her comment/question. I don't know what happened to @Ruth Engle, which I intended to start with.
2024-11-04 13:00:59
J. Woolley
Apparently the Filter and Advanced Filter features of the Data Ribbon only apply down columns, but you can do this to filter across columns:
1. Select the range to filter; do not include a column containing row headers. (You might want to copy the selected range somewhere in case you need to restore it later.)
2. Pick Data > Sort & Filter > Sort (Alt+A+SS), then Options (O) and Sort Left to Right (L), then Sort By parameters.
3. After sorting the range, hide columns you want to filter out.
To restore the original, use Undo (Ctrl+Z). (If this is not practical, see item 1.)
You can also use the FILTER function in Excel 2021 or later to return a filtered range which spills from the formula's cell (not in-place). Filtering multiple rows or columns is possible (see Figure 1 below)
To filter both rows and columns:
1. Use the FILTER function to filter rows (i.e., across columns).
2. Add a header row above the FILTER result.
3. Select the header row and the FILTER result.
4. Pick Data > Sort & Filter > Filter (Alt+A+T) to filter down columns.
Figure 1.
2024-11-03 12:24:56
J. Woolley
The Tip says the following formula applied to its Figure 1 worksheet returns a sum of 0 (zero):
=SUMIF(A1:A7,"0E99",B1:B7)
When I try this in Excel 365 I get 21, not 0. This is because the criteria "0E99" is converted to numeric zero and so are text values '0E11, '0E37, and '0E99 in criteria range A1:A7. The formula sums values in B1:B7 that have the (converted) value zero in A1:A7; i.e., B1+B2+B3+B6.
Re. SUMIF and SUMIFS criteria and criteria range, the Tip says:
...but not if you are matching "0E999" or "1E12". Both of these are treated as text and not converted to numeric values.
I believe "1E12" is converted to a number (not treated as text), but "0E999" is not because it exceeds Excel's numeric limit as explained by Tomek below.
One way to confirm this using the Tip's worksheet is to enter '1E12 in cell A8 and '0E999 in cell A9, then enter the following formula in cell C1
=1*A1
and drag that formula down to cell C9. The result (with cells formatted as General) is illustrated in (see Figure 1 below)
Figure 1.
2024-11-02 22:54:00
Tomek
Rather than modifying your original data, or using wild character match, you could create a helper column, say C in which you would convert the contents of the A column to something that is always a text. For example in cell C1 you could enter formula
=A1 & "n"
and copy it down for as many cells as needed. Then you could use a formula like
=SUMIF(C1:C7,"0E99n",B1:B7)
Another formula in the help column could be
=RIGHT(A1,3)
and then use
=SUMIF(C1:C7,"E99",B1:B7)
2024-11-02 22:24:35
Tomek
To understand this better, you have to realize that 0E99, 0E11, 0E37 or any 0EXX (each X being a digit) evaluates to 0 = 0 * 10^XX.
The same will happen for any 0EXXX as long as XXX is less than 308, as well as for any 0EX.
BTW, theoretically, the largest number that Excel can handle is 1.79769313486232E+308, but numbers with exponent 308 are handled inconsistently, often treated as text.
2024-11-02 07:26:35
Ruth Engle
Excell can run a filter down rows but I am wanting to run the same kind of filter across columns is there a way to do that without transposing the data or is there a way to filter rows and columns is what I would really like to do.
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments