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
Bookmarks