LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default new macro


This sounds like your Totalling sheet is a list of invoices for th
month. Then what you want to do is collect all invoices for eac
company for a monthly statement.

An easy way to do this is to use AutoFilter.

Try using the macro recorder to do this:

Select any cell in your dataset
Turn on the recorder.
Click Data|Autofilter.
In col A select a company
Select the entire range
Insert a new worksheet

Turn off the recorder and look at your new code.


If you make a list of all company names, you can add code to your macr
like this:

Dim oCell as range, x as integer,CompanyName as string
x=sheets.count
For each oCell in Range("CompanyNameList")
CompanyName = oCell.value
....use the code that you recorded....

Copy Destination:= sheet(x).range("A2")
x=x+1
next


this should get you started

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 06:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"