Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy/Paste Row


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

--
Violaplaye
-----------------------------------------------------------------------
Violaplayer's Profile: http://www.excelforum.com/member.php...fo&userid=1621
View this thread: http://www.excelforum.com/showthread.php?threadid=27783

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Copy/Paste Row

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).C opy
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.

"Violaplayer" wrote:


Dear All

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

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

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


WORKSHEET B
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()" on
Worksheet A to satisfy the copy/paste purpose on Worksheet B. Thank
you very much!!

Thanks in advance
Violaplayer


--
Violaplayer
------------------------------------------------------------------------
Violaplayer's Profile: http://www.excelforum.com/member.php...o&userid=16211
View this thread: http://www.excelforum.com/showthread...hreadid=277836


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Copy/Paste Row

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).O ffset(10, 0)

Hope this helps.

"Violaplayer" wrote:


Dear All

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

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

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


WORKSHEET B
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()" on
Worksheet A to satisfy the copy/paste purpose on Worksheet B. Thank
you very much!!

Thanks in advance
Violaplayer


--
Violaplayer
------------------------------------------------------------------------
Violaplayer's Profile: http://www.excelforum.com/member.php...o&userid=16211
View this thread: http://www.excelforum.com/showthread...hreadid=277836


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't Copy and Paste or Paste Special between Excel Workbooks wllee Excel Discussion (Misc queries) 5 April 29th 23 03:43 AM
Copy; Paste; Paste Special are disabled Mack Neff[_3_] Excel Discussion (Misc queries) 0 April 28th 08 06:29 PM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
I cannot paste from one workbook to another. Copy works, paste do. JimmyMc Excel Discussion (Misc queries) 1 June 10th 05 03:54 PM
Macro to Copy/Paste then Paste to Next Line tomkarakowski Excel Programming 1 May 28th 04 01:19 AM


All times are GMT +1. The time now is 02:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"