Results 1 to 4 of 4

Error on If statement

Threaded View

  1. #1
    Registered User
    Join Date
    07-22-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    85

    Error on If statement

    Hi,
    I have a code that aims to comment based on the date values found on column N. However I seem to be encoutering an error with the code when it hits

     S_heet.Select
    below is my full code

    Public Sub ME_comment()
    Dim c_ell As Range, Date_Ref As Date, S_heet As Worksheet
    Date_Ref = InputBox("Enter a reference date", "DATE ENTRY", 200, 200)
    For Each S_heet In ActiveWorkbook.Sheets
    If S_heet.Name <> "Cash Summary" Then
     S_heet.Select
        
        For Each c_ell In Range("N23", Cells(Rows.Count, 23).End(xlUp))
            If IsDate(c_ell) Then
                If c_ell <= Date_Ref Then
                    c_ell.Offset(0, -12) = "ME related"
                End If
            End If
        Next c_ell
    End If
    Next S_heet
    End Sub
    Attached Files Attached Files
    Last edited by kchm_2000; 10-28-2011 at 04:44 AM.

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