+ Reply to Thread
Results 1 to 9 of 9

Looping Code for Pasting

  1. #1
    Registered User
    Join Date
    08-13-2007
    Posts
    68

    Looping Code for Pasting

    Hi, I have borrowed this code form Ron Debruin and am trying to modify it to meet my needs.

    I think everyhting works well except for how I am trying to loop the pasting sequence so that I start pasting rows at row 200 and increment down 1 row at a time.

    I have added the Dimension "R" into the code to try to make it loop

    here's what I have so far:

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Shouldn't this line
    Please Login or Register  to view this content.
    be
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    08-13-2007
    Posts
    68
    Thank you, I have now got the program to paste one line in row 200, but it will not increment down any additional rows.

    Do I have the "R = R+1" in the right location?

    Perhaps I have made this too hard. I need to find "wine" in column "M" and cut/paste every row with wine listed to a new row starting with row 200 and continuing down

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Why not filter on Column M for wine then paste

    something like

    Please Login or Register  to view this content.
    VBA Noob

  5. #5
    Registered User
    Join Date
    08-13-2007
    Posts
    68
    will I need to insert a line of code to past the copied values?

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    This line copies it to row 200. if you have other data then it may be a issue

    Please Login or Register  to view this content.
    VBA Noob

  7. #7
    Registered User
    Join Date
    08-13-2007
    Posts
    68
    THANK YOU!!!

    This worls great.

    Any idea when I change the "copy" to "cut" I get an error message?

    "The command you chose cannot be performed with multiple selections"

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try doing manually. You get the same answer. Excel won't let you cut non continous rows

    Maybe delete the rows after.

    Please Login or Register  to view this content.
    VBA Noob

  9. #9
    Registered User
    Join Date
    08-13-2007
    Posts
    68
    That will work. Thank you so much for your help with this. You have no idea how good it has been to get this going.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Imported VBA code not working....
    By HuskerBronco in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-02-2008, 05:57 PM
  2. CountA - Dynamic Range - Macro
    By elcentro3m in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-10-2007, 02:54 PM
  3. Placement of a particular line of code
    By smurray444 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-19-2007, 11:15 AM
  4. Running code while displaying a UserForm with vbModeless
    By PilgrimTim in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-06-2007, 08:08 AM
  5. Adding code to a form on the fly...
    By Ara in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-01-2007, 03:47 PM

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