Results 1 to 5 of 5

Macro to print page if data in specified cell

Threaded View

  1. #1
    Registered User
    Join Date
    08-27-2004
    Posts
    40

    Macro to print page if data in specified cell

    Hello!

    A few years back someone kindly posted the following code which allowed me to print using a macro any worksheet within my workbook if it had data in a specified cell (in this case A4).

    Dim ws As Worksheet
        Dim first As Boolean
        first = True
        For Each ws In Worksheets
    
        If ws.[A4].Value <> Empty Then
        If first Then
        ws.Select Replace:=True
        first = False
        Else
        ws.Select Replace:=False
        End If
        End If
        Next
       ActiveWindow.SelectedSheets.PrintOut copies:=1
    How can I modify this so that it performs the same process but ONLY on the one worksheet, not all worksheets within a work book?

    Thanks in advance.

    Darren
    Last edited by VBA Noob; 03-05-2008 at 10:50 AM.

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