+ Reply to Thread
Results 1 to 3 of 3

Copy and Paste Loop-a macro

Hybrid View

japorms Copy and Paste Loop-a macro 07-19-2006, 01:17 PM
Guest re: Copy and Paste Loop-a... 07-19-2006, 02:10 PM
japorms Thanks a bunch Tom you're... 07-19-2006, 04:07 PM
  1. #1
    Registered User
    Join Date
    02-26-2004
    Location
    philippines
    Posts
    73

    Copy and Paste Loop-a macro

    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?


  2. #2
    Tom Ogilvy
    Guest

    re: Copy and Paste Loop-a macro

    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. #3
    Registered User
    Join Date
    02-26-2004
    Location
    philippines
    Posts
    73
    Thanks a bunch Tom

    you're my savior

    Hopefully, I'll start learning more of these.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1