+ Reply to Thread
Results 1 to 14 of 14

How to skip line in Code

  1. #1
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Lightbulb How to skip line in Code

    Hi All,

    Below you can see the part of my Code and I need to skip the line:

    Selection.TextToColumns Destination:=Range("BC2"), DataType:=xlFixedWidth, _
    FieldInfo:=Array(Array(0, 1), Array(10, 1)), TrailingMinusNumbers:=True

    So, I need to skip it when I have empty cells in Range ("BC2:BC3000").

    Thank you in advance.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to skip line in Code

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: How to skip line in Code

    Maybe I misunderstood where to put this code, but I am still getting the error.
    In the picture you can see the error that I get and to check if I put the code in the right line.
    Attached Images Attached Images
    Last edited by toci; 03-04-2016 at 08:27 PM.

  4. #4
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: How to skip line in Code

    If range BC2:BC3000 is empty then skip:
    Please Login or Register  to view this content.
    and continue forward.

    *** Other suggestions***
    Last edited by toci; 03-05-2016 at 05:05 AM.

  5. #5
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: How to skip line in Code

    Any new idea?

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to skip line in Code

    What does =COUNTA(BC2:BC3000) return?

  7. #7
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: How to skip line in Code

    I fixed it. Below you can see my solution.
    Thank you for help.
    I appreciate it.
    Please Login or Register  to view this content.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to skip line in Code

    Range("bc2:bc3000").Text will always return Null.

  9. #9
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: How to skip line in Code

    I don't no but it seems to work for me.

    Once more again to see if my solution is right, In Range "BC2:BC3000" I need "Text to Column" based on Values in this range. But when Range "BC2:BC300" is empty (it's depend on some other Column in which I have but in this case I don't have "Date") I get error in this line of Code.
    Therefore, I need to skip this line of Code every time when Range "BC2:BC3000" is empty.
    When I test this code and put some Date in Column e.g. AA (on which Text to Column in Range "BC2:BC3000" depends on) it works.

    So, if I missed something or made wrong, please advise me.

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to skip line in Code

    See the question in post #6.

  11. #11
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: How to skip line in Code

    Quote Originally Posted by shg View Post
    See the question in post #6.
    It returns 6.

  12. #12
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to skip line in Code

    So the range is not empty. That's why the next line executes

  13. #13
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: How to skip line in Code

    Therefore, what should I do as I am not expert in this field?

  14. #14
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to skip line in Code

    Explain in words and sentences what you are trying to do.

+ 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. write code to skip two tabs, create a tab, code, skip two tabs, create a tab, code, etc
    By elmasguapo in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-14-2015, 06:01 PM
  2. Skip line if cell is empty
    By Krist2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-03-2015, 09:56 AM
  3. If statement is true, skip line go to next value
    By jperl in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-24-2014, 12:24 PM
  4. Skip every other line while dragging formula
    By dlswa in forum Excel General
    Replies: 2
    Last Post: 03-05-2012, 09:31 PM
  5. Excel 2007 : Skip a line at change in data
    By afalack in forum Excel General
    Replies: 1
    Last Post: 04-28-2011, 04:50 PM
  6. Need Chart's Line to Skip Zero Values
    By ComcoDG in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 10-14-2008, 11:27 AM
  7. Auto calculate & line skip
    By Attila in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 02-09-2007, 06:10 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