Re: excel 2ooo macro

Giganews Newsgroups
Subject: Re: excel 2ooo macro
Posted by:  Bob Phillips (bob.N…@xxxx.com)
Date: Tue, 23 Jan 2007

Very strange, it puts a selected range into a variable and then doesn't use
it.

Perhaps it should be

Sub PrintOut()
'  ActiveSheet.Unprotect
    Set myRange = Application.InputBox("Select the week number to
print",Type:=8)
    Set myRange = Range(myRange.Offset(0, 6),  _
            myRange.SpecialCells(xlLastCell)).EntireColumn.Hidden = True
    If myRange.Column <> 10 Then
    Range(myRange.Offset(0, -1), Cells(3, 10)).EntireColumn.Hidden = True
    End If
    ActiveSheet.PrintPreview
'    ActiveSheet.PrintOut
    Cells.EntireColumn.Hidden = False
    ActiveSheet.Protect
End Sub

and when prompted, select the first cell of the worksheet range for that
week

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)

"Tim Dolan" <tims-pool-leagu…@snet.net> wrote in message
news:2Zpth.51737$wc5.156…@newssvr25.news.prodigy.net...
> This is the screen that comes up to correct a macro that does not work
> anymore.
> It is a macro that used to be able to print any previous week's data from
> a seniors league that I run.
> If  click on the macro link, I get a window that asks for the week I'd
> like to print.
> I though I remembered to type p and then the week number, but that just
> gives me an error message.
> Then I can go to this screen and the whole third line down(Set my range
> .....) is highlighted in yellow
>
> Would someone help me with this?
>                                                    Tim fm CT
>
> Sub PrintOut()
> '  ActiveSheet.Unprotect
>    Set myWeek = Application.InputBox("Select the week number to print", ,
> , , , , , 8)
>    Set myRange = Range(myRange.Offset(0, 6),
> myRange.SpecialCells(xlLastCell)).EntireColumn.Hidden = True
>    If myRange.Column <> 10 Then
>    Range(myRange.Offset(0, -1), Cells(3, 10)).EntireColumn.Hidden = True
>    End If
>    ActiveSheet.PrintPreview
> '    ActiveSheet.PrintOut
>    Cells.EntireColumn.Hidden = False
>    ActiveSheet.Protect
> End Sub
>
> Sub PrintStandings()
>    ActiveSheet.PageSetup.PrintArea = Range("LeagueStandings").Address
> '    ActiveSheet.PrintPreview
>    ActiveSheet.PrintOut
> End Sub
>
> Sub PrintTopRank()
>    ActiveSheet.PageSetup.PrintArea = Range("TopRank").Address
> '    ActiveSheet.PrintPreview
>    ActiveSheet.PrintOut
> End Sub
>
> Sub PrintWeeklyResults()
>    ActiveSheet.PageSetup.PrintArea = Range("WeeklyResults").Address
>    ActiveSheet.PrintPreview
> '    ActiveSheet.PrintOut
> End Sub

Replies

In response to

excel 2ooo macro posted by Tim Dolan on Tue, 23 Jan 2007