Hello, all.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com
ffice
ffice" /><o
></o
>
<o
></o
>
I apologize if this is a re-tread. I looked for a good hour and did not see the topic addressed, but this doesn't mean I didn't miss a generic title or stop a page short; mea culpa if we've seen this before.<o
></o
>
<o
></o
>
I have a simple task, whereby a daily report is run. A number of rows are transferred to another sheet within the workbook; the column counts can vary, as well as the number of rows, and desired previous data will be on the target worksheet. New data are always pasted below old.<o
></o
>
<o
></o
>
Having pasted the new data, I count the new number of populated rows:<o
></o
>
<o
> </o
>
Range("A1").Select
Range(Selection, Selection.End(xlDown)) Select
MyRows = ActiveWindow.RangeSelection.Rows.Count<o
></o
>
<o
> </o
>
<o
></o
>
Using "MyRows," I want to be able to clean up any rows' garbage below the populated rows. If it were always the same number, I could say:<o
></o
>
<o
></o
>
Rows("10:200").Delete, or<o
></o
>
Rows("27:300").ClearContents <o
></o
>
<o
></o
>
or some such. <o
></o
>
<o
></o
>
But I don't know how to substitute "MyRows + 1" and "MyRows + 200" (e.g.) for the row labels - I'm sure it's exceedingly simple and I'm almost embarrassed to ask, but I can't find this anywhere. I’m hoping to avoid time-consuming loops, as the potential for this to grow to thousands of rows is quite real, and a simple, one- or two-line command would be so much more efficient.<o
></o
>
<o
> </o
>
Thanks.<o
></o
>
<o
I apologize if this is a re-tread. I looked for a good hour and did not see the topic addressed, but this doesn't mean I didn't miss a generic title or stop a page short; mea culpa if we've seen this before.<o
<o
I have a simple task, whereby a daily report is run. A number of rows are transferred to another sheet within the workbook; the column counts can vary, as well as the number of rows, and desired previous data will be on the target worksheet. New data are always pasted below old.<o
<o
Having pasted the new data, I count the new number of populated rows:<o
<o
Range("A1").Select
Range(Selection, Selection.End(xlDown)) Select
MyRows = ActiveWindow.RangeSelection.Rows.Count<o
<o
<o
Using "MyRows," I want to be able to clean up any rows' garbage below the populated rows. If it were always the same number, I could say:<o
<o
Rows("10:200").Delete, or<o
Rows("27:300").ClearContents <o
<o
or some such. <o
<o
But I don't know how to substitute "MyRows + 1" and "MyRows + 200" (e.g.) for the row labels - I'm sure it's exceedingly simple and I'm almost embarrassed to ask, but I can't find this anywhere. I’m hoping to avoid time-consuming loops, as the potential for this to grow to thousands of rows is quite real, and a simple, one- or two-line command would be so much more efficient.<o
<o
Thanks.<o