Hello guys, I'm quite newbie with VBA.

I have a huge file with around 30 sheets and increasing. I've setup 2 different macros. The first one would apply a PageSetup and split the sheet into 7 different pages and the second one would save it as pdf with defined filename from cell value (I've splitted them cos the first one takes a while to apply).

The problem is that if I have to save several sheets by selecting them (select and CNTRL each one) and run my macro it will save the same file with all pages from all sheets selected. E.g. if I've selected 3 sheets (21 pages in total) it will create 3 different pdf files with all 21 pages. AND I WANT EACH ONE SEPARATELY!!!

This is my macro:

Sub CreatePDF()
    Dim mySelectedSheets As Sheets
    Dim wks As Worksheet
    Set mySelectedSheets = ActiveWindow.SelectedSheets
    For Each wks In mySelectedSheets
        wks.Activate
        With wks
            Fname = Range("B2").Value
            ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
            "XXX" & Fname & ".pdf" _ 'address deleted due to privacy issues'
            , IncludeDocProperties:=True, IgnorePrintAreas _
            :=False, OpenAfterPublish:=False
        End With
    Next wks
    Set mySelectedSheets = Nothing
End Sub