+ Reply to Thread
Results 1 to 13 of 13

Help with coding a macro

  1. #1
    Forum Contributor
    Join Date
    08-09-2006
    Posts
    147

    Help with coding a macro

    Below I have this marco the goes from row 2 to 2000(and that's okay), but I don't want to have to later in the year go and update this macor because it has exceed 2000 rows.
    How can I put something like Range(Selection, Selection.End(xlDown)).Select, which goes to last record in place of 2 to 2000?

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Help with coding a macro

    Hi rlkerr,

    Try this:

    Please Login or Register  to view this content.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Forum Contributor
    Join Date
    08-09-2006
    Posts
    147

    Re: Help with coding a macro

    Keeps giving me a syntax error.
    Please Login or Register  to view this content.

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Help with coding a macro

    Try this

    Please Login or Register  to view this content.
    and
    Please Login or Register  to view this content.
    Last edited by mike7952; 10-03-2012 at 02:10 PM.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Help with coding a macro

    @ mike7952,

    Thank you for helping out here Mike,

    I was just going to ask for a sample WorkBook to see what the heck is going on. I have also slipped up badly by excluding the "2 To" bit.

  6. #6
    Forum Contributor
    Join Date
    08-09-2006
    Posts
    147

    Re: Help with coding a macro

    I worked some. It just didn't go all the way to the bottom of the page. I have 280 rows and it stopped on row 23.

    Please Login or Register  to view this content.

  7. #7
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Help with coding a macro

    Give this a try.


    Please Login or Register  to view this content.
    Last edited by mike7952; 10-03-2012 at 03:31 PM.

  8. #8
    Forum Contributor
    Join Date
    08-09-2006
    Posts
    147

    Re: Help with coding a macro

    Okay here is the stange thing. I was making you an example copy to look at and the macro works fine. It goes all the way to the bottom. But, in my actual sheet it only goes to 23. What should I be looking for? I'll keep playing with it.

  9. #9
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Help with coding a macro

    Change this line:

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.

  10. #10
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Help with coding a macro

    In my post, Post #7 it looks for the last cell in Column BW. If BW will not have last cell in the row change this

    Please Login or Register  to view this content.
    Last edited by mike7952; 10-03-2012 at 03:35 PM.

  11. #11
    Forum Contributor
    Join Date
    08-09-2006
    Posts
    147

    Re: Help with coding a macro

    Fixed it. There was a #DIV/0 in column BV. So, made the formula an iferror..... Works fine. Thank you so much for your help. This is awesome. I apologize for it taking so long.

  12. #12
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Help with coding a macro

    Please share with us, which line of Code, solved your problem. We are all here to benefit from feedback.

  13. #13
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Help with coding a macro

    Hello rlkerr,

    Thank you for adding to my Reputation.

    Regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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