5 pts.
 Copy and paste in Excel using Visual Basic scripting?
First of all - Thank you.... I receive info in Excel worksheet "A" with columns of variable length which I want to cut and paste into Excel worksheet "B". Worksheet "A" info starts at B:13 and can range in length from 1 to 200 rows or more. I would like to copy this variable length information then paste into worksheet "B" starting at cell B:13 then on down the column. Can anyone provide the code necessary to accomplisht this? Newbie Brian

Software/Hardware used:
ASKED: July 30, 2008  11:46 PM
UPDATED: August 30, 2008  2:30 AM

Answer Wiki:
Why do you need code to do this? Is the data on worksheet A by itself, and in a contiguous block? If so, Range("B13").CurrentRegion would return a range reference to your data. If there are blanks, then Range(Range("B13"), Range("B" & Rows.Count).End(xlUp)) will return a range reference to your data. To copy and paste it, use this: Dim rng As Excel.Range Dim wksBook As Excel.Worksheet Set rng = Range(Range("B13"), Range("B" & Rows.Count).End(xlUp)) ' or Range("B13").CurrentRegion Set wksBook = Worksheets("B") rng.Copy wksBook.Range("B13") Enjoy, JP
Last Wiki Answer Submitted:  August 30, 2008  2:30 am  by  JP2112   475 pts.
All Answer Wiki Contributors:  JP2112   475 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _