Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Place a character in a cell
I am trying to write a formula that will cause an asterisk to appear in one
cell if another cell has a comment in it. How do I do this? Thanks, |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Place a character in a cell
You could use a user defined function:
Option Explicit Function CellHasComment(rng As Range) As Boolean Application.Volatile CellHasComment = Not (CBool(rng.Cells(1).Comment Is Nothing)) End Function This function may be one calculation behind. It won't update if you add a comment. But should reflect the right answer once excel recalcs. If you're new to macros: Debra Dalgleish has some notes how to implement macros he http://www.contextures.com/xlvba01.html David McRitchie has an intro to macros: http://www.mvps.org/dmcritchie/excel/getstarted.htm Ron de Bruin's intro to macros: http://www.rondebruin.nl/code.htm (General, Regular and Standard modules all describe the same thing.) ======== Short course: Open your workbook. Hit alt-f11 to get to the VBE (where macros/UDF's live) hit ctrl-R to view the project explorer Find your workbook. should look like: VBAProject (yourfilename.xls) right click on the project name Insert, then Module You should see the code window pop up on the right hand side Paste the code in there. Now go back to excel. Into a test cell and type: =cellhascomment(a1) Where A1 contains a comment (or not). Then if that works, try: =IF(CellHasComment(A1),"*","") Lisa38 wrote: I am trying to write a formula that will cause an asterisk to appear in one cell if another cell has a comment in it. How do I do this? Thanks, -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Place a character in a cell
Thank you so much, Dave. You are a big help!!
Lisa "Dave Peterson" wrote: You could use a user defined function: Option Explicit Function CellHasComment(rng As Range) As Boolean Application.Volatile CellHasComment = Not (CBool(rng.Cells(1).Comment Is Nothing)) End Function This function may be one calculation behind. It won't update if you add a comment. But should reflect the right answer once excel recalcs. If you're new to macros: Debra Dalgleish has some notes how to implement macros he http://www.contextures.com/xlvba01.html David McRitchie has an intro to macros: http://www.mvps.org/dmcritchie/excel/getstarted.htm Ron de Bruin's intro to macros: http://www.rondebruin.nl/code.htm (General, Regular and Standard modules all describe the same thing.) ======== Short course: Open your workbook. Hit alt-f11 to get to the VBE (where macros/UDF's live) hit ctrl-R to view the project explorer Find your workbook. should look like: VBAProject (yourfilename.xls) right click on the project name Insert, then Module You should see the code window pop up on the right hand side Paste the code in there. Now go back to excel. Into a test cell and type: =cellhascomment(a1) Where A1 contains a comment (or not). Then if that works, try: =IF(CellHasComment(A1),"*","") Lisa38 wrote: I am trying to write a formula that will cause an asterisk to appear in one cell if another cell has a comment in it. How do I do this? Thanks, -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I want to place a checkbox in the middle of a cell, yet I want thecheckboxArea take up the entire cell. | Excel Discussion (Misc queries) | |||
Automatically place text in one cell into cell in another sheet | New Users to Excel | |||
place text in one cell | Excel Worksheet Functions | |||
How to place a value in another cell | Excel Discussion (Misc queries) | |||
lookup specific character place | Excel Worksheet Functions |