Results 1 to 4 of 4

Need to use looping

Threaded View

  1. #1
    Forum Contributor
    Join Date
    03-13-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2003
    Posts
    152

    Need to use looping

    Hi,

    I have the following codes

    de = 0
    Sheets("Data").Activate
    For i = 2 To LastRow
    If InStr(1, CStr(Cells(i, 2).Value), quarter) <> 0 And InStr(1, CStr(Cells(i, 6).Value), "Detractor") And InStr(1, CStr(Cells(i, 13).Value), "Business") Then
    de = de + 1
    End If
    Next i
    Cells(9, 5).Value = de / x
    de = 0
    Sheets("Data").Activate
    For i = 2 To LastRow
    If InStr(1, CStr(Cells(i, 2).Value), quarter) <> 0 And InStr(1, CStr(Cells(i, 6).Value), "Detractor") And InStr(1, CStr(Cells(i, 13).Value), "IT Manger") Then
    de = de + 1
    End If
    Next i
    Cells(9, 5).Value = de / x
    using the same code for other professionals also ("Business", "IT manager", "Student" etc.,)

    Is there any way to pass the profession as arguments to avoid multiple lines of coding. I have around 25 professions list.

    Please help
    Last edited by gan_xl; 09-16-2013 at 10:44 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Do Until Looping (not looping through all other columns)
    By orle8050 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-11-2013, 10:37 AM
  2. Looping
    By Nordeen1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-15-2012, 12:31 PM
  3. Looping through row
    By dirtydan86 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-03-2012, 10:53 AM
  4. Help:Looping
    By Buffyslay in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2006, 02:00 PM
  5. Looping
    By teresa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-30-2005, 09: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