Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Using 2003
Sheet1: Current macro calculates a range of cells from a fixed upper-left range cells F5 to G200.: (Note that Sheet1 is a Pivot-table already using Auto filter.) Sheets("Pivot Table").Range(Cells(5, "F").Address, Cells _ (Rows.Count, "G").End(xlUp).Address).Copy (followed by:) Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=True, Transpose:=False I would prefer that the copy command would evaluate only the cells whose formula calculates a value. By this I mean: Many of the cells in the F5 to G200 range do not have a calculated value. Assuming that only 5 rows have values, the copy command will copy the calculated range F5 to G200, meaning that 195 two-column cell combinations will be pasted to the receiving range wasting space on Sheet2. My macros then copy another range from Sheet3 beginning at row 201. (Again, there are 195 essentially wasted rows between the cells pasted from Sheet1) I have attempted to Copy using VisibleCells and/or Paste-special SkipBlanks = True - yet I still get the 195 "Wasted-space" cells. It seems that there are three solutions: One is a smarter way to copy only the cells that the underlying formula calculates a value. -or- Another, is to Paste only those cells from Sheet1 which have values (text or numeric) -or- Develope a routine to delete the empty rows on Sheet2. Which of the three is the smartest/most efficient? I need help with coding the syntax in VBA. Thanks, Dennis |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I fix values in cells calculated by formula in Excel | Excel Worksheet Functions | |||
Formula checking multiple worksheets | Excel Worksheet Functions | |||
If formula that looks at multiple cells and values, and then calul | Excel Discussion (Misc queries) | |||
How to copy cells with keeping exact formula intact | Excel Discussion (Misc queries) | |||
How do you copy a cell's content verses it's formula? | Excel Discussion (Misc queries) |