Results 1 to 6 of 6

Adding Else into an If statement

Threaded View

kchm_2000 Adding Else into an If... 10-18-2011, 06:26 AM
TMS Re: Adding Else into an If... 10-18-2011, 06:43 AM
Marcol Re: Adding Else into an If... 10-18-2011, 06:46 AM
snb Re: Adding Else into an If... 10-18-2011, 07:14 AM
kchm_2000 Re: Adding Else into an If... 10-18-2011, 11:39 PM
TMS Re: Adding Else into an If... 10-19-2011, 02:08 AM
  1. #1
    Registered User
    Join Date
    07-22-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    85

    Adding Else into an If statement

    Hi,

    I have a formula that currently replys OK if it captures "C to BBNT" or "Will C SD" on Col D. However I want to add another line that gives me "NOT OK" it it is anything else. Thanks for anyones' help in advance

    Public Sub NT_comment()
    Dim c_ell As Range, Date_Ref As Date, S_heet As Worksheet, c_ell2 As Range
    
    For Each S_heet In ActiveWorkbook.Sheets
    If Left(S_heet.Name, 3) = "ACD" Then
        S_heet.Select
        For Each c_ell In Range("D2", Cells(Rows.Count, 2).End(xlUp))
                If c_ell = "C to BBNT" Then
                    c_ell.Offset(0, 1) = "OK"
                If c_ell = "Will C SD" Then
                    c_ell.Offset(0, 1) = "OK"
                End If
        Next c_ell
    End If
    Next S_heet
    End Sub
    Attached Files Attached Files
    Last edited by kchm_2000; 10-18-2011 at 11:39 PM.

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