+ Reply to Thread
Results 1 to 8 of 8

My macos won't run on the next row (it only works on the first row)

  1. #1
    Forum Contributor
    Join Date
    11-21-2013
    Location
    KL
    MS-Off Ver
    Excel 2010
    Posts
    168

    My macos won't run on the next row (it only works on the first row)

    Hi all, I am a truly newbie in vba macro, any help is very much appreciated.

    In my column A, I have the folloling 9 rows, where row 4 and row 6 are left blank for testing.

    Nominal Date: 1
    Nominal Date: 2
    Nominal Date: 3

    Text

    Nominal Date: 4
    Nominal Date: 5
    Last

    What I wish to do is to seperate the Nominal Date into 2 columns, e.g Nominal Date in column A and the date 1 in column B.
    The blanks cell are for testing whether it will skip and go to the next row.
    The "Tex"t and "Last" row are used for testing as well.

    I came out with the code:

    Please Login or Register  to view this content.

    The problem is, the macro only works on the first row, it will not go down to the second row onwards. I use debugging but it didn't show any error message and the selected cell just stopped at the first row.

    I have no idea what happened. Any help is very much appreciated.

    Thank you.

    PS: I have a long list but the length varies across the months. If possible, I would like to use do until loop instead of For.. next. Is it possible to stop the macro base on the condition of the next row? e.g. if i+1=9 is the text Last, is it possible to stop the macro (or loop the macro) until the row i=8? Thank you very much
    Last edited by hcyeap; 12-01-2013 at 11:14 AM.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: My macos won't run on the next row (it only works on the first row)

    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  3. #3
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: My macos won't run on the next row (it only works on the first row)

    Try this..
    Please Login or Register  to view this content.
    Elegant Simplicity............. Not Always

  4. #4
    Forum Contributor
    Join Date
    11-21-2013
    Location
    KL
    MS-Off Ver
    Excel 2010
    Posts
    168

    Re: My macos won't run on the next row (it only works on the first row)

    Thank you very much patel45!

    Do you mind to enlighten me what went wrong with my code?

    Also, can I do this using Do Until Loop? Because I have a long list and I don't know the actual number of cells until end of the month. However, I do know that the last row will be a text statment, for example "Last" in my example. Can I use text as my condition? So that my macro will stop looping at Nominal Date: 5.

    Thank you!

  5. #5
    Forum Contributor
    Join Date
    11-21-2013
    Location
    KL
    MS-Off Ver
    Excel 2010
    Posts
    168

    Re: My macos won't run on the next row (it only works on the first row)

    Hi AndyLitch, the macro stops at the first row using the code given.

    Thank you very much for your help anyway. Really appreciate that.

  6. #6
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: My macos won't run on the next row (it only works on the first row)

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    11-21-2013
    Location
    KL
    MS-Off Ver
    Excel 2010
    Posts
    168

    Re: My macos won't run on the next row (it only works on the first row)

    Thank you very much.
    Learnt something new today

  8. #8
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: My macos won't run on the next row (it only works on the first row)

    Hi, hcyeap,

    or simplify your code:
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

+ 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. Error creating macos for a spreadsheet to be used for a workout program
    By mdunc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2013, 08:17 PM
  2. Macos If then Statement help
    By bapella in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-12-2012, 02:42 PM
  3. Excel Addin works that works on a template workbook
    By s.jay_k in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-15-2006, 03:35 PM
  4. [SOLVED] Diabling Target Workboon Macos (if necessary)
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2006, 09:15 AM
  5. Replies: 1
    Last Post: 06-21-2005, 12:05 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