LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Is there a way to extract numbers from comments for use in a formu

Let's say we are talking about a single cell that contains a comment and the
comment contains a single number and nothing else. Select the cell and run:

Sub get_comment_number()
Dim s As String, n As Long
With Selection
.Comment.Visible = True
s = .Comment.Text
n = s * 1#
.Value = n
End With
End Sub

The macro will set the value of the cell equal to the number in the comment.


Remember:
1.the original contents of the cell will be over-written
2.will work only on a single cell
3.the comment must be a single number
--
Gary's Student


"cadscout" wrote:

I have comments that have numbers in them that I would like to be able to
extract from the comments and use a mathematical formula (simple
multiplication) to find the product of the numbers.

Thanks for any help that you can provide!

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
extract number and use in formula from text & numbers in cell ivory_kitten Excel Worksheet Functions 3 July 14th 06 05:38 AM
Extract numbers from cell with Text and Numbers wiredwrx New Users to Excel 3 April 18th 06 10:57 PM
Extract only numbers from an alphanumeric field in Excel? Brian Excel Discussion (Misc queries) 2 April 3rd 06 07:57 PM
Extract Certain Characters and Numbers JavyD Excel Worksheet Functions 3 March 28th 06 04:09 PM
How do you extract numbers from a string of chacters in a cell (E. blackbeemer Excel Worksheet Functions 6 November 12th 04 09:00 AM


All times are GMT +1. The time now is 11:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"