Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using Command Button to copy cells | Excel Discussion (Misc queries) | |||
Copy down - special to fill only the blank cells | Excel Discussion (Misc queries) | |||
How do I copy cells and skip lines? | Excel Discussion (Misc queries) | |||
how do I make a copy of a worksheet and retain formulas but not data | Setting up and Configuration of Excel | |||
copy group of cells to another group of cells using "IF" in third | Excel Worksheet Functions |