Replace your code withand let me know how that goes.![]()
Sub print_selected_items() Dim cellrow As Integer Dim cellcollum As Integer Dim cellvalue As String Dim cellcollumbarcode As Integer Dim Ws1 As Worksheet Set Ws1 = Worksheets("OPENPOS") cellrow = 2 'Test cell row number cellcollum = 15 'Test cell collum number cellcollumbarcode = 17 ' Print cell collum number cellvalue = "" ' Test cell deciding factor For cellrow = 2 To 100 'For loop that index the cell row looking for a "true" cellvalue = Ws1.Cells(cellrow, cellcollum).Value 'sets varible equal to test cell If cellvalue = "True" Then Ws1.PageSetup.PrintArea = Worksheets("OPENPOS").Cells(cellrow, cellcollum).Address With Ws1 .PrintOut , , 1 End With End If Next cellrow 'indexes for loop End Sub











LinkBack URL
About LinkBacks
Register To Reply
Bookmarks