Copy/Paste Row

  • Thread starter Thread starter Violaplayer
  • Start date Start date
V

Violaplayer

Dear All

I am new to VBA, I would be very grateful if you can provide a scrip
for me :)
This is my case, I have two worksheets. Worksheet A has a button an
Worksheet B has 5 rows record.

What I want is, if I press the button on Worksheet A it will copy th
LAST row on Worksheet B and paste it 10 to 20 down

===================================
WORKSHEET
BUTTON <-------- When button pressed


WORKSHEET
12 34 45 12
45
18 74 55 32
46
14 67 85 52
75
13 34 44 34
45
34 86 67 52
35 <------copy this row
row 1 .........................
row 2 .........................
row 3 .........................
row 4 .........................
row 5 .........................
row 6 .........................
row 7 .........................
row 8 .........................
row 9 .........................
row 10 .........................
34 86 67 52
35 <------ paste it after row 10
===================================

Can anyone give me a VBA script using "CommandButton1_Click()" o
Worksheet A to satisfy the copy/paste purpose on Worksheet B. Than
you very much!!

Thanks in advance
Violaplaye
 
The following should do it (copy as all one line in your module and change
the sheet name appropriately):

Sheets("Sheet_B_Name").Range("A65536").End(xlUp).Copy
Destination:=Sheets("Sheet_B_Name").Range("A65536").End(xlUp).Offset(10, 0)

NOTE: This will only work if nothing else resides below your data in the
sheet.
 
Sorry, the other version only copies the cell, the one below copies the
entire row:

Sheets(2).Range("A65536").End(xlUp).EntireRow.Copy
Destination:=Sheets(2).Range("A65536").End(xlUp).Offset(10, 0)

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top