A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Access2000: Copy a range of rows to another range of rows using VBA



 
 
Thread Tools Display Modes
  #1  
Old May 7th, 2004, 01:29 PM
Arvi Laanemets
external usenet poster
 
Posts: n/a
Default Access2000: Copy a range of rows to another range of rows using VBA

Hi

I need VBA procedure to copy some 4 rows, and then paste copied rows into
some n*4-row range on same worksheet. I can do it, selecting the range,
copying it, selecting another range, and pasting. But I wonder, is it
possible to do it without activating ranges - like I dit it for deleting:
Sheets("SheetName").Range((9 + 4 * NewNumAll) & ":" &
LastRow).Delete
and it worked nicely. I tried with (It was meant to copy last 4 rows of used
range, and then add n*4 rows, so that the new used range would be
8+4*NewNumAll rows)
Sheets("SheetName").Range((LastRow - 3) & ":" & LastRow).Copy
Sheets("SheetName").Range((LastRow + 1) & ":" & 8 + 4 *
NewNumAll).Paste
but nothing happened.


--
Arvi Laanemets
(When sending e-mail, use address arvilAttarkon.ee)


  #2  
Old May 10th, 2004, 08:48 AM
Arvi Laanemets
external usenet poster
 
Posts: n/a
Default Access2000: Copy a range of rows to another range of rows using VBA

I did find the solution
Sheets("SheetName").Range((LastRow - 3) & ":" &
LastRow).Copy(Sheets("SheetName").Range((LastRow + 1) & ":" & 8 + 4 *
NewNumAll))


--
Arvi Laanemets
(When sending e-mail, use address arvilAttarkon.ee)




"Arvi Laanemets" wrote in message
...
Hi

I need VBA procedure to copy some 4 rows, and then paste copied rows into
some n*4-row range on same worksheet. I can do it, selecting the range,
copying it, selecting another range, and pasting. But I wonder, is it
possible to do it without activating ranges - like I dit it for deleting:
Sheets("SheetName").Range((9 + 4 * NewNumAll) & ":" &
LastRow).Delete
and it worked nicely. I tried with (It was meant to copy last 4 rows of

used
range, and then add n*4 rows, so that the new used range would be
8+4*NewNumAll rows)
Sheets("SheetName").Range((LastRow - 3) & ":" & LastRow).Copy
Sheets("SheetName").Range((LastRow + 1) & ":" & 8 + 4 *
NewNumAll).Paste
but nothing happened.


--
Arvi Laanemets
(When sending e-mail, use address arvilAttarkon.ee)




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:07 PM.


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