ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pasting Macro (https://www.excelbanter.com/excel-programming/348554-pasting-macro.html)

wilro85[_10_]

Pasting Macro
 

I'm working on a paste special macro so as to help aliviate some of the
difficulties accociated with using my parts list.

If will work in the following manner

Paste the values to a static location (say forinstand, A200)
Count the size of the selection
Cut & Paste A200 to location
cut & paste A201 to location + 1
cut & paste A202 to location + 2
etc.

Here is the trick... when I get to row 40 or so, I have to skip about 4
rows then resume. How do I do that?


--
wilro85
------------------------------------------------------------------------
wilro85's Profile: http://www.excelforum.com/member.php...o&userid=26935
View this thread: http://www.excelforum.com/showthread...hreadid=494956


Excelibur[_4_]

Pasting Macro
 

It's difficult to point out a good solution without knowing the basic
code structure, but here's an idea:


Code:
--------------------
:startloop
If <offset = 40 then <offset = <offset + 4
cut & paste A200.offset(<offset, 0) to location
<offset = <offset + 1
:endloop
--------------------


Hope this helps!


--
Excelibur
------------------------------------------------------------------------
Excelibur's Profile: http://www.excelforum.com/member.php...o&userid=29788
View this thread: http://www.excelforum.com/showthread...hreadid=494956


wilro85[_11_]

Pasting Macro
 

What I'm expirmenting with looks something like this. I just need a
example of how to put a controled "skip" into the break.

Sub test()
co = ActiveCell.Column
ro = ActiveCell.Row
Range("A100").PasteSpecial Paste:=xlValues
num = Selection.Count
For i = 0 To num
Range((Cells(100 + i, 1))).Cut Range(Cells(ro + i, co)) 'I'm having a
error here for some reason, too.
Next i
End Su

--
wilro8
-----------------------------------------------------------------------
wilro85's Profile: http://www.excelforum.com/member.php...fo&userid=2693
View this thread: http://www.excelforum.com/showthread.php?threadid=49495



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

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