Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / March 2008

Tip: Looking for answers? Try searching our database.

not able to print from line a4

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Khalil Handal - 06 Mar 2008 22:38 GMT
The following code ends in print preview starting line 7 and not line 4. any
suggestions please. I changed A7 to A4 in the with statement and still the
same problem.

Sub Picture22_Click()

Dim c As Range
Application.ScreenUpdating = False
   With ActiveSheet.Range("A7:A159")
       Do
           Set c = .Find("", LookIn:=xlValues, LookAt:=xlWhole, _
                   MatchCase:=False)
           If c Is Nothing Then Exit Do
           c.EntireRow.Hidden = True
       Loop
       .Range("A4:D160").PrintPreview
       .EntireRow.Hidden = False
   End With
Application.ScreenUpdating = True
End Sub
Dave Peterson - 07 Mar 2008 00:09 GMT
This statement:

   With ActiveSheet.Range("A7:A159")
      ....
       .Range("A4:D160").PrintPreview

is the same as:

ActiveSheet.Range("A7:A159").Range("A4:D160").PrintPreview

Which points at A10:D166

You may want:

      .parent.Range("A4:D160").PrintPreview

 

> The following code ends in print preview starting line 7 and not line 4. any
> suggestions please. I changed A7 to A4 in the with statement and still the
[quoted text clipped - 16 lines]
> Application.ScreenUpdating = True
> End Sub

Signature

Dave Peterson

Khalil handal - 07 Mar 2008 06:41 GMT
Hi,
Thanks

> This statement:
>
[quoted text clipped - 34 lines]
>> Application.ScreenUpdating = True
>> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.