L
lcheni
I was trying to code VBA to copy a dynamic range from Worksheet 1,
count the number of rows of the range (single column), then in
Worksheet 2, tried to insert the counted number of rows beginning at
the selected cell before pasting the selected range.
,,,
ActiveCell.Resize(n).EntireRow.Insert
activecell.paste
However, after the row insert, the range is pasted all the way across
the worksheet (same data coped to the column IV).
===================================================
I found that I needed to revise the codes to the below:
1) from Wksht 1, located the range, count the rows involved
2) go to Wksht 2, insert the rows needed
3) return to Wksht 1. copy the range
4) back to Wksht 2, pasted the range .
Are there some easy ways to do this?
Thanks.
count the number of rows of the range (single column), then in
Worksheet 2, tried to insert the counted number of rows beginning at
the selected cell before pasting the selected range.
,,,
ActiveCell.Resize(n).EntireRow.Insert
activecell.paste
However, after the row insert, the range is pasted all the way across
the worksheet (same data coped to the column IV).
===================================================
I found that I needed to revise the codes to the below:
1) from Wksht 1, located the range, count the rows involved
2) go to Wksht 2, insert the rows needed
3) return to Wksht 1. copy the range
4) back to Wksht 2, pasted the range .
Are there some easy ways to do this?
Thanks.