Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello All,
I am using Excel 97 and need some help with VBA as I don't know it all that well. Before the below macro is run, the end user needs to save the workbook as CSRreport.xls. However, some users forget to save the workbook under the new name before running the macro, which then causes a problem with the original file (workbook). I need the macro (below) to first check that the workbook is named €œCSRreport.xls€ before the rest of the code continues. How can I add to the following code at the beginning to check that the workbook name is €œCSRreport.xls€ and if it isnt, display a message box informing the user to save the file as €œCSRreport.xls and try the macro again. Sub CSRreport() ' CSRreport Macro ' Macro recorded 5/10/2006 ' If Worksheets("PastDue").Visible = True Then Worksheets("PastDue").Visible = False End If Worksheets("Label Number").Select Range("U3").Select CSRFilter CSRPrintarea Range("A:A,D:D,F:G,J:M,S:S,T:T,U:U,V:V,W:W,X:X,Y:Y ,Z:Z,AA:AA").Select Range("AA2").Activate Selection.EntireColumn.Hidden = True CSRTitle End Sub TIA Jan |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA macro runs fine, but freezes if I try to do ANYTHING else whileit runs | Setting up and Configuration of Excel | |||
how to create a macro that runs other macro in the same workbook | Excel Programming | |||
Macro runs in source , but not when in Personal Macro Workbook | Excel Programming | |||
Excel Workbook automatically (by design) runs a macro | Excel Programming | |||
Excel Workbook automatically (by design) runs a macro | Excel Programming |