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 / January 2007

Tip: Looking for answers? Try searching our database.

excel 2ooo macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tim Dolan - 23 Jan 2007 15:37 GMT
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
Bob Phillips - 23 Jan 2007 17:03 GMT
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

Signature

---
HTH

Bob

(change the xxxx to gmail if mailing direct)

> This is the screen that comes up to correct a macro that does not work
> anymore.
[quoted text clipped - 42 lines]
> '    ActiveSheet.PrintOut
> End Sub
Tim Dolan - 26 Jan 2007 00:51 GMT
Hi Bob,
          Thanks for your info. I cut and pasted your modification into the
macro and it did the same thing.
         I know so little about this stuff. ugh!

> Very strange, it puts a selected range into a variable and then doesn't
> use it.
[quoted text clipped - 65 lines]
>> '    ActiveSheet.PrintOut
>> End Sub
Tim Dolan - 30 Jan 2007 16:22 GMT
> Hi Bob,
>           Thanks for your info. I cut and pasted your modification into
[quoted text clipped - 70 lines]
>>> '    ActiveSheet.PrintOut
>>> End Sub

Darn, I wish someone would jump back in and try to help me get that macro
working again.

                      Tim fm CT
 
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.