This is a syntax/beginners question:
Im making a system to print a single cell that will contain a barcode.
I'm writing a basic macro that uses a for loop to print cells. I'm using the cells() command to reference the test cell so I can index it by using a number. (Instead of using range() which has a LetterNumber reference.) The problem exist when I want to print the single cell. I'm trying to use .printout with cells() and I'm having an issue. Help me correct it or find something better. The code is below and a picture.
Sub print_selected_items()
Dim cellrow As Integer
Dim cellcollum As Integer
Dim cellvalue As String
Dim cellcollumbarcode As Integer
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 = Cells(cellrow, cellcollum).Value 'sets varible equal to test cell
If cellvalue = "True" Then Printout.Cells(cellrow, cellcollum) copies:=1 'Prints barcode if test cell is equal to "true"
Next cellrow 'indexes for loop
End Sub
GIVE ME YOUR THOUGHTS!!
Bookmarks