+ Reply to Thread
Results 1 to 5 of 5

Macro - Coding to repeat process on different row

  1. #1
    Registered User
    Join Date
    06-16-2011
    Location
    Hartford, Connecticut
    MS-Off Ver
    Excel 2007
    Posts
    5

    Macro - Coding to repeat process on different row

    I have some coding to make a combo box.

    Range("AK4").Select
    ActiveSheet.DropDowns.Add(2040, 110.25, 63, 15.75).Select
    With Selection
    .ListFillRange = "$BA$12:$BA$14"
    .LinkedCell = "$BC$4"
    .DropDownLines = 8
    .Display3DShading = False
    End With

    I want to repeat this process for about 200 rows. I know you can put an "i" [I believe] in the place of the row # and say something like for i=# to i=# and so on. I just don't remember how to do it exactly.

    I have made the row #s that must change RED. Thank you!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,591

    Re: Macro - Coding to repeat process on different row

    You'd do it like this, however, you're putting the combo boxes in the same place.

    You need to work out where you want to put them in relation to the cells.

    Regards


    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    06-16-2011
    Location
    Hartford, Connecticut
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Macro - Coding to repeat process on different row

    Thank you so much! That's very helpful. Now how do I work out where to put them. I want them all to be in the same column, just one row after another.

    Thank you!

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,591

    Re: Macro - Coding to repeat process on different row

    You can position the combobox based on the coordinates of the cell:

    ?range("AK4").Top
    45
    ?range("AK4").left
    1728
    ?range("AK4").Width
    48
    ?range("AK4").height
    15
    ?range("AK4").left+range("AK4").Width
    1776

    You probably need to add a little "white space" but that's fine tuning.

    Regards

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,591

    Re: Macro - Coding to repeat process on different row

    Please Login or Register  to view this content.

    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