ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel macro to copy rows in one sheet and insert into another sheet (https://www.excelbanter.com/excel-discussion-misc-queries/446057-excel-macro-copy-rows-one-sheet-insert-into-another-sheet.html)

Vasanth

Excel macro to copy rows in one sheet and insert into another sheet
 
I need a excel macro to copy some rows in worksheet 1 to insert into 3rd row of worksheet 2. The number of rows to be copied depends on the value present in column A3 of worksheet 1


eg .


AAA 123 2
BBB 456
DDD 789

here 2 in 1st row decides the number of rows to be copied


Please help me in this issue.


Thanks
Vasanth

Gord Dibben[_2_]

Excel macro to copy rows in one sheet and insert into another sheet
 
An observation and a question.

1. Looks like the number 2 is in C1, not A3

2. Which two of the three rows shown would you want copied to Sheet2?


Gord

On Tue, 15 May 2012 05:51:23 +0000, Vasanth
wrote:


I need a excel macro to copy some rows in worksheet 1 to insert into
3rd row of worksheet 2. The number of rows to be copied depends on the
value present in column A3 of worksheet 1


eg .


AAA 123 2
BBB 456
DDD 789

here 2 in 1st row decides the number of rows to be copied


Please help me in this issue.


Thanks
Vasanth


harishchet

Quote:

Originally Posted by Gord Dibben[_2_] (Post 1601782)
An observation and a question.

1. Looks like the number 2 is in C1, not A3

2. Which two of the three rows shown would you want copied to Sheet2?


Gord

On Tue, 15 May 2012 05:51:23 +0000, Vasanth
wrote:


I need a excel macro to copy some rows in worksheet 1 to insert into
3rd row of worksheet 2. The number of rows to be copied depends on the
value present in column A3 of worksheet 1


eg .


AAA 123 2
BBB 456
DDD 789

here 2 in 1st row decides the number of rows to be copied


Please help me in this issue.


Thanks
Vasanth


Gord,
Even I have the same Issue.I need to copy data from one Excel to another.Second Excel is a master copy where I ahve to Insert the data from the First sheet form the 2nd Row.Could you please help me out in doing so!!!

Regards
HC

Gord Dibben[_2_]

Excel macro to copy rows in one sheet and insert into another sheet
 
Your great lack of detail makes it difficult to provide any help.

I am not sure what an "Excel" is

So far I see you have two sheets

Where would you like the data from row2 of First sheet inserted into
Master sheet?

This macro will copy row2 from sheet2 to last row in Master sheet.

Sub findbottom_paste()
Dim rng1 as Range
Set rng1 = Sheets("Master").Cells(Rows.Count, 1).End(xlUp) _
.Offset(1, 0)
Worksheets("Sheet2").Range("2:2").Copy _
Destination:=rng1
End Sub


Gord

On Thu, 17 May 2012 13:05:07 +0000, harishchet
wrote:

Gord,
Even I have the same Issue.I need to copy data from one Excel to
another.Second Excel is a master copy where I ahve to Insert the data
from the First sheet form the 2nd Row.Could you please help me out in
doing so!!!

Regards
HC


harishchet

Quote:

Originally Posted by Gord Dibben[_2_] (Post 1601855)
Your great lack of detail makes it difficult to provide any help.

I am not sure what an "Excel" is

So far I see you have two sheets

Where would you like the data from row2 of First sheet inserted into
Master sheet?

This macro will copy row2 from sheet2 to last row in Master sheet.

Sub findbottom_paste()
Dim rng1 as Range
Set rng1 = Sheets("Master").Cells(Rows.Count, 1).End(xlUp) _
.Offset(1, 0)
Worksheets("Sheet2").Range("2:2").Copy _
Destination:=rng1
End Sub


Gord

On Thu, 17 May 2012 13:05:07 +0000, harishchet
wrote:

Gord,
Even I have the same Issue.I need to copy data from one Excel to
another.Second Excel is a master copy where I ahve to Insert the data
from the First sheet form the 2nd Row.Could you please help me out in
doing so!!!

Regards
HC


Thnaks Gord for the reply.....

Let me tell you the requirement clearly.

I have 2 Workbooks...Workbook1 and workbook2.

I have to copy data from sheet1 in Workbook1 and insert to the 2nd row in sheet1 of workbook2.

Data can be of more than 1 row so this has to be inserted form Row2 of sheet1 in workbook 2.

Hoping I am clear with my explaination.

Thanks and Regards
HC

Gord Dibben[_2_]

Excel macro to copy rows in one sheet and insert into another sheet
 
Getting closer.

Copy data from workbook1 sheet1 to workbook2 sheet1.

Insert copied data at row 2 of workbook2 sheet1.

Questions.................

Shift any existing data down?

Copied data from workbook1 sheet1 can be be more than one
row..........where is the data and how is the number of rows in that
data range determined?


Gord


On Fri, 18 May 2012 05:34:18 +0000, harishchet
wrote:

Thnaks Gord for the reply.....

Let me tell you the requirement clearly.

I have 2 Workbooks...Workbook1 and workbook2.

I have to copy data from sheet1 in Workbook1 and insert to the 2nd row
in sheet1 of workbook2.

Data can be of more than 1 row so this has to be inserted form Row2 of
sheet1 in workbook 2.

Hoping I am clear with my explaination.

Thanks and Regards



All times are GMT +1. The time now is 03:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com