Results 1 to 3 of 3

Help for loop vba

Threaded View

  1. #1
    Registered User
    Join Date
    04-13-2011
    Location
    Cyprus
    MS-Off Ver
    Excel 2003
    Posts
    2

    Help for loop vba

    Dear all I am trying to write a vba with no luck. I want in column k to change the values according the values in column g
    Please anybody can help with the following, it seems right to me but i doesn't do anything.

    Private sub loopthrough()
    
    for i = 3 to 100 
    
    vartest = (Members.cells("G",i).value)
    
    Select case vartest    
           case "15 DAYS"        
    
    varresult = "31"    
    
    case "1 MONTH"        
    
    varresult = "50"    
    
    case "3 MONTHS"        
    
    varresult = "135"  
    
    case "6 MONTHS"        
    
    varresult = "235"    
    
    case "12 MONTHS"        
    
    varresult = "430"  
    
    case "18 MONTHS"        
    
    varresult = "615"    
    
    case else        
    
    varresult = ""
    
    end select
    
    Members.cells("K",i).formula = varresult
    
    Next i
    
    end sub
    Last edited by teylyn; 08-22-2011 at 04:55 AM. Reason: added code tags

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