Results 1 to 4 of 4

transferring comments to a neighbouring cell

Threaded View

  1. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    http://exceltips.vitalnews.com/Pages..._to_Cells.html
    gives this code
    Sub CommentsToCells()
    
    
        Dim rCell As Excel.Range
        Dim rData As Excel.Range
        Dim sComment As String
    
        ' Horizontal displacement
        Const iColOffset As Integer = 1 ' change value to how many cells to the right you need to go
    
         
         ' extract comments from selected range
        If TypeName(Selection) = "Range" Then
            Set rData = Intersect(Selection, ActiveSheet.UsedRange)
            For Each rCell In rData.Cells
                On Error Resume Next
                sComment = rCell.Comment.Text
                If Len(sComment) > 0 Then
                    rCell.Offset(, iColOffset).Value = sComment
                    rCell.Comment.Delete
                End If
                sComment = ""
                On Error GoTo 0
            Next
        End If
    End Sub
    just tried it and it works a treat
    just select all cells in the column with comments as a contiguous range,and run code
    Last edited by martindwilson; 09-16-2008 at 05:32 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro to copy cell comments to a new cell?
    By MyBrainhURTS in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-04-2009, 11:20 AM
  2. How to Extract Cell "Comments"
    By CharlieO in forum Excel General
    Replies: 2
    Last Post: 03-31-2008, 07:06 PM
  3. Inserting a row does not increment reference in cell
    By diguerd in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-15-2008, 01:26 PM
  4. Replies: 2
    Last Post: 03-07-2008, 08:05 PM

Tags for this Thread

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