Results 1 to 3 of 3

Extract contents of cell if greater than zero to a comment

Threaded View

  1. #1
    Forum Contributor
    Join Date
    07-24-2008
    Location
    San Antonio, Texas
    Posts
    118

    Extract contents of cell if greater than zero to a comment

    I am trying to extract contents of cell to a comment.

    Column K is Overtime Hours
    Column L is Regular Hours

    I have managed to create the following macro that will copy the contents of a cell in Column K and put it as a comment in Column L. But I am needing the macro only to create a comment if the value of the cell in Column K is greater than 0

    Sub InsertOvertimeComment()
    Dim Rgtime As Range
    Dim NRg As Range
    
    Set Rgtime = Range(Range("L1"), Range("L1").End(xlDown))
    On Error Resume Next
    For Each NRg In Rgtime
    With NRg
    .AddComment Text:=NRg.Offset(0, -1).Text
    End With
    Next
    
    End Sub
    Any help would be appreciated. Thanks
    Last edited by randolphoralph; 12-30-2009 at 06:10 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