+ Reply to Thread
Results 1 to 4 of 4

Repeat actions in a Loop

  1. #1
    Valued Forum Contributor abduljaleel.mca's Avatar
    Join Date
    02-13-2013
    Location
    Chennai, India
    MS-Off Ver
    MS 365 Business
    Posts
    326

    Repeat actions in a Loop

    Hi,

    How to do the below steps in a loop instead of multiple lines.

    If (ser = 1) Then na = "A"
    If (ser = 2) Then na = "B"
    If (ser = 3) Then na = "C"
    If (ser = 4) Then na = "D"
    If (ser = 5) Then na = "E"
    If (ser = 6) Then na = "F"
    If (ser = 7) Then na = "G"
    If (ser = 8) Then na = "H"
    If (ser = 9) Then na = "I"
    If (ser = 10) Then na = "J"
    If (ser = 11) Then na = "K"
    If (ser = 12) Then na = "L"
    If (ser = 13) Then na = "M"
    If (ser = 14) Then na = "N"
    If (ser = 15) Then na = "O"
    If (ser = 16) Then na = "P"
    If (ser = 17) Then na = "Q"
    If (ser = 18) Then na = "R"
    If (ser = 19) Then na = "S"
    If (ser = 20) Then na = "T"
    If (ser = 21) Then na = "U"
    If (ser = 22) Then na = "V"
    If (ser = 23) Then na = "W"
    If (ser = 24) Then na = "X"
    If (ser = 25) Then na = "Y"
    If (ser = 26) Then na = "Z"
    If (ser = 27) Then na = "AA"
    If (ser = 28) Then na = "AB"
    If (ser = 29) Then na = "AC"
    If (ser = 30) Then na = "AD"
    If (ser = 31) Then na = "AE"
    If (ser = 32) Then na = "AF"
    If (ser = 33) Then na = "AG"
    If (ser = 34) Then na = "AH"
    If (ser = 35) Then na = "AI"
    If (ser = 36) Then na = "AJ"
    If (ser = 37) Then na = "AK"
    If (ser = 38) Then na = "AL"
    If (ser = 39) Then na = "AM"
    If (ser = 40) Then na = "AN"
    If (ser = 41) Then na = "AO"
    If (ser = 42) Then na = "AP"
    If (ser = 43) Then na = "AQ"
    If (ser = 44) Then na = "AR"
    If (ser = 45) Then na = "AS"
    If (ser = 46) Then na = "AT"
    If (ser = 47) Then na = "AU"
    If (ser = 48) Then na = "AV"
    If (ser = 49) Then na = "AW"
    If (ser = 50) Then na = "AX"
    If (ser = 51) Then na = "AY"
    If (ser = 52) Then na = "AZ"
    If (ser = 53) Then na = "BA"
    If (ser = 54) Then na = "BB"
    If (ser = 55) Then na = "BC"
    If (ser = 56) Then na = "BD"
    If (ser = 57) Then na = "BE"
    If (ser = 58) Then na = "BF"
    If (ser = 59) Then na = "BG"
    If (ser = 60) Then na = "BH"
    If (ser = 61) Then na = "BI"
    If (ser = 62) Then na = "BJ"
    If (ser = 63) Then na = "BK"
    If (ser = 64) Then na = "BL"
    If (ser = 65) Then na = "BM"
    If (ser = 66) Then na = "BN"
    If (ser = 67) Then na = "BO"
    If (ser = 68) Then na = "BP"
    If (ser = 69) Then na = "BQ"
    If (ser = 70) Then na = "BR"
    If (ser = 71) Then na = "BS"
    If (ser = 72) Then na = "BT"
    If (ser = 73) Then na = "BU"
    If (ser = 74) Then na = "BV"
    If (ser = 75) Then na = "BW"
    If (ser = 76) Then na = "BX"
    If (ser = 77) Then na = "BY"
    If (ser = 78) Then na = "BZ"
    Last edited by abduljaleel.mca; 02-19-2013 at 11:27 AM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Loop

    You could try this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Repeat actions in a Loop

    Hi abduljaleel.mca

    No clue what you're doing but here's a convoluted way to do it
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Valued Forum Contributor abduljaleel.mca's Avatar
    Join Date
    02-13-2013
    Location
    Chennai, India
    MS-Off Ver
    MS 365 Business
    Posts
    326

    Re: Repeat actions in a Loop

    Hi Jaslake,

    I have used Norie's code and it is working great.

    Thanks guys for your help.

+ 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