views:

172

answers:

2

I make a index of a list of sheets in a workbook, i will like to print some of then (list in column A, a mark in column B the ones i would like to print)

Do you have some code for it, in VBA Excel???

I Will really thanks

+2  A: 
Sub PrintSheets()
  Dim cell As Range
  For Each cell In Sheet1.Range("A1:A10") '''(change this)
    If cell.Offset(0, 1).Value <> "" Then
      Sheets(cell.Value).PrintOut
    End If
  Next cell
End Sub
guitarthrower
+1  A: 

How about using a sheet's property to select which sheets to print.

Like the tab color - easy to set and a nice visual indicator.

    Sub PrintSheets()
        Dim sb As String
        sb = Application.StatusBar
        If sb = "False" Then sb = ""

        Dim ws As Worksheet
        For Each ws In ActiveWorkbook.Worksheets
            If 0 < ws.Tab.ColorIndex Then
                Application.StatusBar = "Printing " & ws.Name & " ..."
                ws.PrintOut
            End If
        Next

        Application.StatusBar = sb
End Sub
Andrew