Help!!! Excel/VBA
The need: To collapse a spreadsheet by deleting irrelevant rows conditioned
on a cell in the row.
Question 1: Is there an intrinsic way of doing this built into Excel?
Question 2: I am trying to do it with VBA by cutting and pasting rows as
follows :
ActiveSheet.Rows(quot;(SrcRow)quot;).Cut
ActiveSheet.Rows(quot;(DsrRow)quot;).Paste
I keep getting “Type mismatch error” messages. I tried other variations but
I get the impression that “Cut” and “Paste” and “Rows” and “Range” only
accept constants to designate a range, not variables.
What am I doing wrong?
Thanks, Robert HolloNo idea what you are doing, but assuming that SrcRow and DsrRow are range
variables, perhaps
ActiveSheet.Rows(SrcRow).Cut
ActiveSheet.Rows(DsrRow).Paste--
HTH
RP
(remove nothere from the email address if mailing direct)quot;FRquot; gt; wrote in message
...
gt; Help!!! Excel/VBA
gt; The need: To collapse a spreadsheet by deleting irrelevant rows
conditioned
gt; on a cell in the row.
gt; Question 1: Is there an intrinsic way of doing this built into Excel?
gt; Question 2: I am trying to do it with VBA by cutting and pasting rows as
gt; follows :
gt; ActiveSheet.Rows(quot;(SrcRow)quot;).Cut
gt; ActiveSheet.Rows(quot;(DsrRow)quot;).Paste
gt; I keep getting quot;Type mismatch errorquot; messages. I tried other variations
but
gt; I get the impression that quot;Cutquot; and quot;Pastequot; and quot;Rowsquot; and quot;Rangequot; only
gt; accept constants to designate a range, not variables.
gt;
gt; What am I doing wrong?
gt;
gt; Thanks, Robert Hollo
gt;
Maybe........ Data gt; Filter gt; AutoFilter, then select the value of interest
in the column of interest and filter..........then delete those rows
Vaya con Dios,
Chuck, CABGx3
quot;FRquot; wrote:
gt; Help!!! Excel/VBA
gt; The need: To collapse a spreadsheet by deleting irrelevant rows conditioned
gt; on a cell in the row.
gt; Question 1: Is there an intrinsic way of doing this built into Excel?
gt; Question 2: I am trying to do it with VBA by cutting and pasting rows as
gt; follows :
gt; ActiveSheet.Rows(quot;(SrcRow)quot;).Cut
gt; ActiveSheet.Rows(quot;(DsrRow)quot;).Paste
gt; I keep getting “Type mismatch error” messages. I tried other variations but
gt; I get the impression that “Cut” and “Paste” and “Rows” and “Range” only
gt; accept constants to designate a range, not variables.
gt;
gt; What am I doing wrong?
gt;
gt; Thanks, Robert Hollo
gt;
- Jul 16 Mon 2007 20:38
Excel/VBA
close
全站熱搜
留言列表
發表留言