Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2003: Macro to print areas in mulptiple worksheets | Excel Discussion (Misc queries) | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Print and Print Preview Graphic Moving Resizing 2007/2003 | Excel Discussion (Misc queries) | |||
I cannot seem to print certain workbooks from Excel 2003 | Excel Discussion (Misc queries) | |||
Excel 2003 does not print the right font | Excel Discussion (Misc queries) |