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 and Paste Loop


I have a problem here and my head hurts in figuring this out. Up to
now, I'm still a newbie when it comes to VB macro programming. There's
just too many object and command for me to read before I can learn all
these.

This may be challenging, easy for some but very hard for me.

I need a macro that will search from A1 to A1000 and look for blanks in
that row. once it find that blank cell, it needs to copy that row,
starting from B to K and paste it in a row before that blank cells but
it needs to paste it in column L and if theres still blank after that
one, it needs to paste the succeeding rows in still the row before the
blanks and this time it needs to be paste in column W

This is really hard for me. Can someone help please?

:(


--
japorms
------------------------------------------------------------------------
japorms's Profile: http://www.excelforum.com/member.php...fo&userid=6544
View this thread: http://www.excelforum.com/showthread...hreadid=562970

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Copy and Paste Loop

Sub FixRows()
lastrow = Cells(Rows.Count, "B").End(xlUp).Row
baserow = 1
For i = 2 To lastrow
If Len(Trim(Cells(i, 1))) < 0 Then
baserow = i
cnt = 0
Else
With Cells(i, 2).Resize(1, 9)
.Copy Destination:= _
Cells(baserow, "K").Offset(0, cnt * 12)
.ClearContents
End With
cnt = cnt + 1
End If
Next
On Error Resume Next
Set rng = Columns(1).SpecialCells( _
xlBlanks).EntireRow.Delete
End Sub


Test it on a copy of your data.
--
Regards,
Tom Ogilvy


"japorms" wrote:


I have a problem here and my head hurts in figuring this out. Up to
now, I'm still a newbie when it comes to VB macro programming. There's
just too many object and command for me to read before I can learn all
these.

This may be challenging, easy for some but very hard for me.

I need a macro that will search from A1 to A1000 and look for blanks in
that row. once it find that blank cell, it needs to copy that row,
starting from B to K and paste it in a row before that blank cells but
it needs to paste it in column L and if theres still blank after that
one, it needs to paste the succeeding rows in still the row before the
blanks and this time it needs to be paste in column W

This is really hard for me. Can someone help please?

:(


--
japorms
------------------------------------------------------------------------
japorms's Profile: http://www.excelforum.com/member.php...fo&userid=6544
View this thread: http://www.excelforum.com/showthread...hreadid=562970


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy and Paste Loop


Thanks a bunch Tom

you're my savior :)

Hopefully, I'll start learning more of these.




--
japorms
------------------------------------------------------------------------
japorms's Profile: http://www.excelforum.com/member.php...fo&userid=6544
View this thread: http://www.excelforum.com/showthread...hreadid=562970

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
VBA Loop to Find then Copy & Paste B J Hankinson Excel Discussion (Misc queries) 0 April 15th 09 06:39 PM
Copy/Paste Loop Jelly''s Excel Programming 0 December 6th 05 10:10 PM
copy,paste and loop through workbook TUNGANA KURMA RAJU Excel Discussion (Misc queries) 0 December 6th 05 12:31 PM
Loop: Copy and paste range that changes with every iteration Allen Geddes Excel Programming 0 November 15th 05 12:58 PM
copy and paste loop Dillonstar[_5_] Excel Programming 1 December 11th 03 04:22 PM


All times are GMT +1. The time now is 05:24 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"