+ Reply to Thread
Results 1 to 5 of 5

Cutting a row with conditions

  1. #1
    Forum Contributor
    Join Date
    11-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    200

    Cutting a row with conditions

    I have a macro that will cut and paste a line to another tab but I want to add a layer. I want to only allow it to work if there is text entered in column "B" of that row. If there is no text, I want a message box that pops up and says "must enter..." and does not execute the macro. Is this possible?


    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    11-04-2013
    Location
    Chesham
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Cutting a row with conditions

    is this ok?:

    Please Login or Register  to view this content.
    Last edited by alansidman; 09-16-2015 at 09:12 PM. Reason: code tags added

  3. #3
    Forum Contributor
    Join Date
    11-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    200

    Re: Cutting a row with conditions

    That is bringing up the text box even when there is text in that cell in that column??? Also, you stated "or to whatever row you end at". My code is to cut that row and that row only if nothing is in that cell in that particular column. So would that be 1 to 1??

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,865

    Re: Cutting a row with conditions

    @Tnashnhsp1

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (Because you are new to the forum, I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Registered User
    Join Date
    11-04-2013
    Location
    Chesham
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Cutting a row with conditions

    Hi, the above assumed you wanted to start looking in cell B1 to check if there is any text in the cell, if you are starting at B2 you will need to change x = 1 to 10 to x = 2 to 10

    The x = 1 to to 10 part above is just the rows it goes through and checks to see if the cell is blank, not the rows you want to delete, that bit is in the part I can see in your original code which I thought you would want to keep.

    Feel free to upload a template without any personal info if this hasn't helped!

+ 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. VBA not cutting off copy
    By mbrooks8282 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-29-2015, 02:14 PM
  2. Text cutting
    By faisal.ta in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-04-2013, 04:31 AM
  3. Cutting Formula ?
    By petersona01 in forum Excel General
    Replies: 5
    Last Post: 10-05-2011, 10:43 AM
  4. Cutting Formula?
    By petersona01 in forum Excel General
    Replies: 1
    Last Post: 09-30-2011, 01:19 PM
  5. Bar Cutting Optimization????
    By sajferris in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-11-2006, 04:05 AM
  6. Bar Cutting Optimization????
    By sajferris in forum Excel General
    Replies: 1
    Last Post: 08-10-2006, 06:15 AM
  7. Cutting every other row from a spreadsheet
    By jc40 in forum Excel General
    Replies: 2
    Last Post: 05-31-2006, 03:04 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