Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default Excel print code modification

I need to somehow change the below code so that it only prints data
that is visible after it's filtered on the data sheet. Is this
possible?

Public Const APPNAME As String = "Elephants R Us"
Option Explicit

Sub PrintForms()
Dim StartRow As Integer
Dim EndRow As Integer
Dim Msg As String
Dim i As Integer

Sheets("Form").Activate
StartRow = Range("StartRow")
EndRow = Range("EndRow")

If StartRow EndRow Then
Msg = "ERROR" & vbCrLf & "The starting row must be less than
the ending row!"
MsgBox Msg, vbCritical, APPNAME
End If

For i = StartRow To EndRow
Range("RowIndex") = i
If Range("Preview") Then
ActiveSheet.PrintPreview
Else
ActiveSheet.PrintOut
End If
Next i
End Sub

Sub EditData()
Worksheets("Data").Activate
Range("A1").Select
End Sub

Sub ReturnToForm()
Worksheets("Form").Activate
Range("RowIndex").Select
End Sub
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code modification help AndyMP Excel Worksheet Functions 1 February 8th 09 11:41 PM
Code modification please Tom Excel Programming 3 April 27th 07 02:22 PM
Modification in the CODE to HIDE rows and columns that start with ZERO (code given) Thulasiram[_2_] Excel Programming 4 September 26th 06 04:15 AM
modification for the code srinivasan Excel Programming 2 August 20th 05 03:12 PM
Code modification to accomodate scaling and print areas. Phil Hageman[_3_] Excel Programming 2 February 26th 04 02:06 PM


All times are GMT +1. The time now is 08:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"