Results 1 to 2 of 2

How to Print a Selection of cells

Threaded View

simplificated How to Print a Selection of... 10-23-2013, 12:39 PM
humdingaling Re: How to Print a Selection... 10-23-2013, 07:58 PM
  1. #1
    Registered User
    Join Date
    10-11-2013
    Location
    Personal
    MS-Off Ver
    Excel 2010
    Posts
    13

    How to Print a Selection of cells

    Hi with this code Below I would like to send this (the selection of cells with text) to Print preview and print it using a button.
    The code is fine....I just would like to know how to print the selected text. Thanks


    Sub SelectActualUsedRange()
      Dim FirstCell As Range, LastCell As Range
    
    'handle any errors 
    On Error Resume Next
    
      Set LastCell = Cells(Cells.Find(What:="*", SearchOrder:=xlRows, _
          SearchDirection:=xlPrevious, LookIn:=xlValues).Row, _
          Cells.Find(What:="*", SearchOrder:=xlByColumns, _
          SearchDirection:=xlPrevious, LookIn:=xlValues).Column)
      Set FirstCell = Cells(Cells.Find(What:="*", After:=LastCell, SearchOrder:=xlRows, _
          SearchDirection:=xlNext, LookIn:=xlValues).Row, _
          Cells.Find(What:="*", After:=LastCell, SearchOrder:=xlByColumns, _
          SearchDirection:=xlNext, LookIn:=xlValues).Column)
      Range(FirstCell, LastCell).Select
    End Sub
    Moderator's note: Please review forum rules. Rule #3 requires CODE tags around code to preserve readability. I have added them this time because you are a new user. --6SJ
    Last edited by 6StringJazzer; 10-23-2013 at 02:00 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Autolock Cells from a Drop Down List Selection and a Calendar Selection
    By John Anderson in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-04-2013, 10:54 AM
  2. Replies: 0
    Last Post: 10-04-2012, 01:25 PM
  3. Print Selection Using VBA
    By Kipster1203 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-17-2010, 02:00 PM
  4. Replies: 1
    Last Post: 04-02-2006, 10:10 AM
  5. How do I print a selection of cells using a macro?
    By gussuffert in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2005, 05:06 PM

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