Merging Macros

dcwinter

Board Regular
Joined
Aug 10, 2007
Messages
118
Hi All,

For the last few years, this site has proved invaluable, and I can't thank you all enough of your help. Unfortunately, I've been using Excel less and less recently and my ability to get remember how to do things is diminishing!

I've been trying on and off for a year now to get these two macros to work - but it would be great if I could also merge them. I can't understand what is going wrong with them at all - I have had them working in the past which is even more confusing:

Code:
Sub Macro12()
Sheets("Dashboard").Select
ActiveSheet.Unprotect
Range("C46").Select
Dim myRng As Range
Set myRng = Range("C46", Range("C71").End(xlUp))
Application.ScreenUpdating = False
For Each c In myRng
If c.Value = "" Then c.EntireRow.Hidden = True
Next c
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub

Sub Macro13()
Sheets("Dashboard").Select
ActiveSheet.Unprotect
Range("C46").Select
Dim myRng As Range
Set myRng = Range("C46", Range("C71").End(xlUp))
Application.ScreenUpdating = False
For Each c In myRng
If c.Value = "NA" Then c.EntireRow.Hidden = True
Next c
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub

Have I made any obvious errors? Does anyone have any other options?

Many thanks in advance for any help you can give me - if I complete this, I will finish this particular project :)

Regards


DC
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
in the first macro change it to

Code:
If c.Value = "" or c.value="NA" Then c.EntireRow.Hidden = True
then second macro may not be necessary. test
 
Upvote 0

Forum statistics

Threads
1,214,801
Messages
6,121,644
Members
449,045
Latest member
Marcus05

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