Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-13-2014, 11:37 PM
RogerB RogerB is offline Retrieving data from cell Comments Windows XP Retrieving data from cell Comments Office 2007
Novice
Retrieving data from cell Comments
 
Join Date: Jun 2014
Location: Northumberland UK
Posts: 1
RogerB is on a distinguished road
Default Retrieving data from cell Comments

I have a worksheet with many cell comments, each comment in exactly the same format, (author, date, amount). I now wish to collate all this data into an MS Access database, but cannot find out how to extract the comment data via Visual Basic.

Any help would be much appreciated.



Regards RogerB
Reply With Quote
  #2  
Old 06-14-2014, 09:11 AM
BobBridges's Avatar
BobBridges BobBridges is offline Retrieving data from cell Comments Windows 7 64bit Retrieving data from cell Comments Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

I don't fool with comments much, but I did have a program update comments once, long ago. Let's see, here....

Well, it looks like all you have to do is look at the Comment property of a given cell. If there's no comment on that cell, the Comment property is Nothing. If it's not nothing, then you can look at Comment.Text to see what's in it. That's not all there is to comments, of course, but maybe that's all you need to get started.
Reply With Quote
  #3  
Old 06-14-2014, 02:06 PM
charlesdh charlesdh is offline Retrieving data from cell Comments Windows 7 32bit Retrieving data from cell Comments Office 2010 32bit
Expert
 
Join Date: Apr 2014
Location: Mississippi
Posts: 382
charlesdh is on a distinguished road
Default

Hi,

Check this site to see if it helps. If you still need help come on back.

http://www.contextures.com/xlcomments03.html
Reply With Quote
  #4  
Old 06-16-2014, 03:04 AM
macropod's Avatar
macropod macropod is offline Retrieving data from cell Comments Windows 7 32bit Retrieving data from cell Comments Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Extracting cell comments is quite simple. For example:
Code:
Sub ExportComments()
  Dim InputRange As Range, StrCmnt as String
  Set InputRange = Application.InputBox (prompt:= "What Range?",Type:=8)
  On Error Resume Next
  For Each cell in InputRange
    StrCmnt = StrCmnt & Cell.Address & ": " & Mid(Cell.Comment.Text, Len(Cell.Comment.Author) + 3) & vbCr
  Next
MsgBox StrCmnt
End sub
This macro will prompt for a range of cells from which to extract the comments. It will then display those comments in a message box, with the cell addresses.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying data from one cell to another where condition is third cell fairyca Excel 4 03-30-2014 08:22 AM
Retrieving data from cell Comments Retrieving data from a list or database. Vic01 Word 14 11-14-2013 12:46 AM
Retrieving deleted data charles Outlook 0 12-23-2012 10:58 PM
Copy all comments & cell contents (i.e. data) to word? IanM Excel 0 07-03-2010 11:14 PM
Cell Comments in a Protected spreadsheet dmgerber Excel 1 06-06-2010 05:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:23 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft