Selecting Cells with Value and skipping the word False

PapaRainman

New Member
Joined
Dec 19, 2019
Messages
6
Office Version
  1. 2019
Platform
  1. Windows
Hi Guys!

It is my first time here on Mr.Excel forums and would want to seek for your help.

What I would want to do is to:

1. Select the cells that has value
2. Skip selecting the entire row or cells that has "False" word in it, as there is an IF formula that returns false if it has no value to consider
3. Include the total amount at the very bottom
4. Include the #N/A as it is a valid information, I think it will be included once we selected cells with value
5. Selecting the cells with values and print it as PDF

I was able to do the print it as PDF but 1-3 and selecting the cells with values before printing is what really bugs me.

Here is my code:

VBA Code:
Sub SelectAndCreatePDF()
Dim i As Integer, PDFindex As Integer
    Dim PDFfileName As String
    Dim LR As Long, cell As Range, rng As Range

    Range("A1:H12").Select
      ActiveSheet.PageSetup.Orientation = xlLandscape
      ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF
      ActiveSheet.PageSetup.PrintArea = "A1:H12"
      With Application.FileDialog(msoFileDialogSaveAs)
      
      PDFindex = 0
        For i = 1 To .Filters.Count
            If InStr(VBA.UCase(.Filters(i).Description), "PDF") > 0 Then PDFindex = i
        
        Next
        .Title = "Save sheet as PDF"
        .InitialFileName = PDFName
        .FilterIndex = PDFindex
        
        If .Show Then
            ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=.SelectedItems(1), _
                Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
        End If
      
End With

End Sub

I also included a screenshot of what it looks like.

Thank you very much and hope you could help me.
 

Attachments

  • ScreenHunter 02.png
    ScreenHunter 02.png
    38.4 KB · Views: 13

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Sounds to me you want to hide those rows that have FALSE in them before saving as PDF.
 
Upvote 0

Forum statistics

Threads
1,224,836
Messages
6,181,248
Members
453,026
Latest member
cknader

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