Excel VBA hide rows from range with value at multiple protected sheets

dj022

New Member
Joined
Jul 24, 2015
Messages
2
I have tried finding code for hiding rows from range with value criteria, with applying it to multiple protected sheets. Could someone help build the right code.Original code as following (i'll explain what i would need after the code):

Sub CreatePDF_ERIKHONOKRISSEPETE()
sheetname = ActiveSheet.Namework
bookname = ActiveWorkbook.Name
Dim shtAry()
ReDim shtAry(3) ' this is an array of length X ?
For I = 1 To 4
shtAry(I - 1) = Sheets(I).Name
Debug.Print Sheets(I).Name
Next I
ThisWorkbook.Sheets(shtAry).Select
Debug.Print ThisWorkbook.Path & "\"ActiveSheet.ExportAsFixedFormat xlTypePDF, ThisWorkbook.Path & "\" & Range("TARKISTUSSIVU!$U$1").Value & ".pdf", _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=True
ThisWorkbook.Sheets(sheetname).Select
End Sub

So this function creates one pdf file from protected sheets 1 to 4. I would wan't that this function would hide all rows that have value "0" in range F10:F39, in all previously selected protected sheets. So the pdf would not have those wanted hidden rows present neither of pdf pages (protected sheets). After pdf creation, the hidden lines would be unhidden again.

I would be thankful from help.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
hi

you can use the below code

Selection.AutoFilter
ActiveSheet.Range("$A$1:$D$11").AutoFilter Field:=1, Criteria1:="="
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,314
Members
449,081
Latest member
tanurai

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