+ Reply to Thread
Results 1 to 9 of 9

Cutting and inserting rows

  1. #1
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,168

    Cutting and inserting rows

    Hi.
    Is there another way to write this code:
    Please Login or Register  to view this content.
    It's a recorded code but when i plug it into my module the code won't execute properly.

  2. #2
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,127

    Re: Cutting and inserting rows

    No, ws is not defined, nor LR.

  3. #3
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,168

    Re: Cutting and inserting rows

    Sorry, i posted the middle of the code.
    It's a really long code and i didn't want to make things more confusing.
    I defined WS and LR earlier in the code.

  4. #4
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,127

    Re: Cutting and inserting rows

    What is the name of the sheet for ws? Is it Sheets("CustomerList"?

  5. #5
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,168

    Re: Cutting and inserting rows

    Yes. The name of WS is customerlist

  6. #6
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,127

    Re: Cutting and inserting rows

    If you have set ws=Sheets("CustomerList") some where in your code, you could omit this line Sheets
    Please Login or Register  to view this content.
    and start with

    Please Login or Register  to view this content.
    But this line will also error.
    Please Login or Register  to view this content.
    Which range are you selecting before you want to cut that range?

  7. #7
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,127

    Re: Cutting and inserting rows

    This code does not make any sense, but could give you some direction.

    Please Login or Register  to view this content.

  8. #8
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,168

    Re: Cutting and inserting rows

    Here is the entire code.
    I indictaed the part that excel is highlighting for me.

    Please Login or Register  to view this content.

  9. #9
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,127

    Re: Cutting and inserting rows

    With ws.Range("A" & LR)
    means the last row in column A is selected.
    You can not insert a row if the last row in column A is above 4.
    You could try

    Please Login or Register  to view this content.

+ 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. [SOLVED] cutting rows in each worksheet
    By aaaaa34 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-28-2014, 03:16 AM
  2. Replies: 9
    Last Post: 12-15-2013, 09:46 PM
  3. Cutting the same data from different rows and pasting them into the same rows
    By Sal1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2010, 05:22 PM
  4. Inserting, Cutting, and Pasting Rows Based on What's in a Cell
    By 4EverLearning in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-05-2010, 04:42 PM
  5. Cutting and inserting a column
    By Tjeu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-20-2010, 11:40 AM

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