Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Print macro for Excel 2003.

Hi,

I would like to create a macro that print my excel
worksheet from row 1 to a value in a certain cell. How do
I do that?

/Johan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default Print macro for Excel 2003.

The following should get you started:

Dim N
Dim cell As Range
N = Application.InputBox("Enter a value")
If TypeName(N) = "Boolean" Then Exit Sub
Columns("D:D").Select
Set cell = Columns("d:d").Find(What:=N, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False)
If cell Is Nothing Then
MsgBox "No value found"
Else
ActiveSheet.PageSetup.PrintArea = Range(Range("a1"), cell).Address
End If

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"Johan" wrote in message
...
Hi,

I would like to create a macro that print my excel
worksheet from row 1 to a value in a certain cell. How do
I do that?

/Johan



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
Excel 2003: Macro to print areas in mulptiple worksheets Balcott Excel Discussion (Misc queries) 1 December 19th 07 08:34 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Print and Print Preview Graphic Moving Resizing 2007/2003 Adam Rayburn Excel Discussion (Misc queries) 0 April 4th 07 04:18 PM
I cannot seem to print certain workbooks from Excel 2003 C Goebel Excel Discussion (Misc queries) 4 December 19th 05 09:18 PM
Excel 2003 does not print the right font Joe B Excel Discussion (Misc queries) 0 November 2nd 05 08:27 PM


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

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

About Us

"It's about Microsoft Excel"