Results 1 to 8 of 8

Error in Macro to print a Range

Threaded View

  1. #1
    Forum Contributor
    Join Date
    07-21-2009
    Location
    Kuwait
    MS-Off Ver
    Excel 2019
    Posts
    292

    Angry Error in Macro to print a Range

    Sub test()
    Dim LastRowToPrint As Long
    Dim PrintArea As Range
    Dim FirstCellToPrint As String
    Dim LastColumnToPrint As String

    FirstCellToPrint = "A1"
    LastColumnToPrint = "E"

    'Find the last row of data:
    LastRow = Cells(Rows.Count, "A").End(xlUp).Row

    Set PrintArea = Range(FirstCellToPrint & ":" & LastColumnToPrint & LastRowToPrint)

    End Sub
    I m getting a probelm in above code and need little immediately, when i run it a message appear that "Method "Range" of object _Global Failed..

    Can some one correct it..Sheet is attached i want to print 3 ranges as in sheet from 3 different macros but range always decreasing and increasing.

    Thanks in advance

    Book1.xls
    Last edited by tariqnaz2005; 11-11-2009 at 08:54 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