Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
LJB
 
Posts: n/a
Default How to copy subtotalled cells to a new worksheet (in a macro), wi.

Need to copy subtotals to a new worksheet as one of many steps included in a
macro. The row number for the subtotals will change each month. Any ideas
how to include this copy & paste in a macro without grabbing the wrong row on
the 2nd and subsequent months? Thanks!
--
LJB
  #2   Report Post  
JMB
 
Posts: n/a
Default

You could use named ranges (name the cells using the name box in upper left
corner). Then, instead of

Range("A1").Copy

Use Range("NamedRange").Copy


Or, if your subotals are the last row in a particular column, you could run
a search on this forum for "last row" and you'll find the syntax for finding
the last cell in a column that has data in it.

"LJB" wrote:

Need to copy subtotals to a new worksheet as one of many steps included in a
macro. The row number for the subtotals will change each month. Any ideas
how to include this copy & paste in a macro without grabbing the wrong row on
the 2nd and subsequent months? Thanks!
--
LJB

  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

Record a macro when you apply the subtotals.

Use the outlining symbols at the left to hide what you want hidden.

Select your range
edit|goto|special|visible cells only

Copy and paste.

That recorded macro should be pretty close to what you need.

LJB wrote:

Need to copy subtotals to a new worksheet as one of many steps included in a
macro. The row number for the subtotals will change each month. Any ideas
how to include this copy & paste in a macro without grabbing the wrong row on
the 2nd and subsequent months? Thanks!
--
LJB


--

Dave Peterson
Reply
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
Using Command Button to copy cells Pennington Excel Discussion (Misc queries) 1 April 29th 05 02:30 AM
Copy down - special to fill only the blank cells Mike Excel Discussion (Misc queries) 3 April 18th 05 10:08 PM
How do I copy cells and skip lines? con_jon Excel Discussion (Misc queries) 1 February 17th 05 09:59 PM
how do I make a copy of a worksheet and retain formulas but not data FireBrick Setting up and Configuration of Excel 2 December 29th 04 07:33 PM
copy group of cells to another group of cells using "IF" in third Chuckak Excel Worksheet Functions 2 November 10th 04 06:04 PM


All times are GMT +1. The time now is 04:40 PM.

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

About Us

"It's about Microsoft Excel"