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

copy content of Q3 and Paste it to H4
copy content of Q12 and Paste it to H13
..
..
..
copy content of Q3288 and Paste it to H3289

what my below program doing wrong for above job?

Sub copyPaste()
Dim j As Long

For j = 3288 To 3 Step -9
R(j)C(17).select.copy
R(j+1)C(7).select.paste
Next j
End Sub

thanks for your help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copy & Paste


In your code you dont need the selects and stepping -9 won't do every
row from 3288 up! try this:
Sub copyPaste()
Dim i As Long
For i = 3288 To 3 Step -1
Range("Q" & i).Copy Destination:=Range("H" & i + 1)
Next i
End Sub



Darius;318465 Wrote:
copy content of Q3 and Paste it to H4
copy content of Q12 and Paste it to H13
..
..
..
copy content of Q3288 and Paste it to H3289

what my below program doing wrong for above job?

Sub copyPaste()
Dim j As Long

For j = 3288 To 3 Step -9
R(j)C(17).select.copy
R(j+1)C(7).select.paste
Next j
End Sub

thanks for your help



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=89054

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default copy & Paste

If your object is to copy each 9th cell from the bottom up to another column
on the same row +1, try this

Sub copyevery9thfrombottomup()
mc = "q"
For i = Cells(Rows.Count, mc).End(xlUp).Row To 3 Step -9
Cells(i, mc).Copy Cells(i + 1, "H")
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Darius" wrote in message
...
copy content of Q3 and Paste it to H4
copy content of Q12 and Paste it to H13
.
.
.
copy content of Q3288 and Paste it to H3289

what my below program doing wrong for above job?

Sub copyPaste()
Dim j As Long

For j = 3288 To 3 Step -9
R(j)C(17).select.copy
R(j+1)C(7).select.paste
Next j
End Sub

thanks for your help


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default copy & Paste

hi
try this
Sub copyPaste()
Dim j As Long

For j = 3288 To 3 Step -9

Range("Q" & j).Copy Destination:=Range("H" & j + 1)

Next j
End Sub

regards
FSt1

"Darius" wrote:

copy content of Q3 and Paste it to H4
copy content of Q12 and Paste it to H13
.
.
.
copy content of Q3288 and Paste it to H3289

what my below program doing wrong for above job?

Sub copyPaste()
Dim j As Long

For j = 3288 To 3 Step -9
R(j)C(17).select.copy
R(j+1)C(7).select.paste
Next j
End Sub

thanks for your help

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default copy & Paste

Your copy/paste syntax is incorrect

Sub copyPaste()

For j = 3288 To 3 Step -9

Cells(j, 17).Copy
Cells(j + 1, 7).Select
ActiveSheet.Paste

Next j

End Sub

--
If this helps, please remember to click yes.


"Darius" wrote:

copy content of Q3 and Paste it to H4
copy content of Q12 and Paste it to H13
.
.
.
copy content of Q3288 and Paste it to H3289

what my below program doing wrong for above job?

Sub copyPaste()
Dim j As Long

For j = 3288 To 3 Step -9
R(j)C(17).select.copy
R(j+1)C(7).select.paste
Next j
End Sub

thanks for your help



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
Automating copy/paste/paste special when row references change Carl LaFong Excel Programming 4 October 8th 07 06:10 AM
help w/ generic copy & paste/paste special routine DavidH[_2_] Excel Programming 5 January 23rd 06 03:58 AM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
Copy and Paste macro needs to paste to a changing cell reference loulou Excel Programming 0 February 24th 05 10:29 AM


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

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

About Us

"It's about Microsoft Excel"