Results 1 to 6 of 6

.Printout syntax issue

Threaded View

  1. #1
    Registered User
    Join Date
    09-21-2011
    Location
    Illinois, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    .Printout syntax issue

    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!!
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by rhuseman; 09-21-2011 at 10:27 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1