How do I input a code?

tmleafs

Board Regular
Joined
Apr 16, 2008
Messages
80
I've searched the forms and I have found a few codes that I want to use.

The first is for all capital letters. I can't seem to find it again, but I'm sure that I will sometime soon.

The second is a code that hides all rows that have a zero in a specific column.

Will these codes stay there for the life of the file or do I have to re-enter them every time I want to use it?

Thanks.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Sub HideRowsIfSumZero()
Dim cell As Range
Application.ScreenUpdating = False
For Each cell In Range("W4:W50")
If UCase(cell.Value) = "0" Then
cell.EntireRow.Hidden = True
End If
Next
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Press ALT + F11 to open the Visual Basic, select Module from the Insert menu and paste the code into the white space on the right.

Press ALT + Q to close the code window, Press ALT + F8, click on the name of the macro then click the Run button.
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

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