PC Review


Reply
Thread Tools Rate Thread

Creating spreadsheets for managers with mutiple tabs

 
 
Nico
Guest
Posts: n/a
 
      2nd Jul 2008
Hello,

I'm modifying a macro created by someone else years before, and I'm trying
to clean up a process, but I'm experiencing some difficulty getting it to
work right.

At the moment the macro looks at a list of managers and applications in one
spreadsheet, filters for each manager and pastes the results into a template
spreadsheet which it saves with the manager's name. Though I'm sure there's
an easier way to do this, this part works fine.

When the person created the macro this reporting only covered about 4
applications, but today we're looking at 30+ for each manager (each
application in its own tab) and the macro is crashing halfway through.

If they don't have any users on a given application, I don't want a new tab
created (keeps the file size down, and reduces unnecessary clicking on their
part).

Below is the end part of the code, where it's crashing (Master = the
spreadsheet with all applications and all managers):

Windows(Master).Activate
For Applc = 1 To Sheets.Count
AttReq = "Yes"
Windows(Master).Activate
Sheets(Applc).Select
SheetName = ActiveSheet.Name

Selection.AutoFilter Field:=1, Criteria1:=SPOC

Cells.Select
Selection.Copy

Windows(SPOCFile).Activate

Sheets(SheetName).Select
Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False

Cells.EntireColumn.AutoFit
Range("A1").Select

If IsEmpty(Cells(2, 1).Value) Then
Cells.Select
Selection.Clear

End If

Is there a way to clear the paste, or a better way to do this?

Thanks for any help you may be able to offer!
 
Reply With Quote
 
 
 
 
Nico
Guest
Posts: n/a
 
      4th Jul 2008
Anyone...?

Thanks...!

"Nico" wrote:

> Hello,
>
> I'm modifying a macro created by someone else years before, and I'm trying
> to clean up a process, but I'm experiencing some difficulty getting it to
> work right.
>
> At the moment the macro looks at a list of managers and applications in one
> spreadsheet, filters for each manager and pastes the results into a template
> spreadsheet which it saves with the manager's name. Though I'm sure there's
> an easier way to do this, this part works fine.
>
> When the person created the macro this reporting only covered about 4
> applications, but today we're looking at 30+ for each manager (each
> application in its own tab) and the macro is crashing halfway through.
>
> If they don't have any users on a given application, I don't want a new tab
> created (keeps the file size down, and reduces unnecessary clicking on their
> part).
>
> Below is the end part of the code, where it's crashing (Master = the
> spreadsheet with all applications and all managers):
>
> Windows(Master).Activate
> For Applc = 1 To Sheets.Count
> AttReq = "Yes"
> Windows(Master).Activate
> Sheets(Applc).Select
> SheetName = ActiveSheet.Name
>
> Selection.AutoFilter Field:=1, Criteria1:=SPOC
>
> Cells.Select
> Selection.Copy
>
> Windows(SPOCFile).Activate
>
> Sheets(SheetName).Select
> Range("A1").Select
> ActiveSheet.Paste
> Application.CutCopyMode = False
>
> Cells.EntireColumn.AutoFit
> Range("A1").Select
>
> If IsEmpty(Cells(2, 1).Value) Then
> Cells.Select
> Selection.Clear
>
> End If
>
> Is there a way to clear the paste, or a better way to do this?
>
> Thanks for any help you may be able to offer!

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open mutiple spreadsheets in one session of Excel and use 'ALT' + ppatel Microsoft Excel Setup 2 23rd Jun 2009 09:39 PM
Export to Mutiple Spreadsheets icq_giggles Microsoft Access Getting Started 1 5th Mar 2009 11:40 AM
query results shown on mutiple spreadsheets =?Utf-8?B?bWFya3RoZW5ld2JpZQ==?= Microsoft Access Queries 2 20th Feb 2006 12:42 AM
How to use mutiple spreadsheets in a pivot table? =?Utf-8?B?SWFuIFBlZXJz?= Microsoft Excel Misc 1 10th Aug 2005 08:54 PM
macro to rename mutiple spreadsheets when being saved Mikey May Microsoft Excel Misc 5 19th Nov 2003 05:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:41 PM.