Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Having comments copied when using formulas

Hi there. I am using multiple worksheets for work and each employee has their
own sheets where they enter their daily numbers. The employee sheets are
linked to a master and updated automatically. However, if they put a comment
in the cell for a particular day, it is not copied over with the formula. I
know that it is possible if you use the copy and paste special function but I
am using the = function to copy from one worksheet to another (daily
sheet.xls]Aug 07 - Sept 07'!$B$4). Since I am only using the = function, the
comment is not forwarded? Any way I can change that? Please help€¦ I am
totally frustrated. Thanks a million in advance.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Having comments copied when using formulas

First, I think I'd ask them to use an adjacent column for their comments. It
would make things lots easier for you and them (they could filter by that
additional column to see various comments).

But if you want...

You'll need a macro.

Saved from a previous post:

If you want to use a user defined function to get the value and the comment --
but not the formatting, you could use:

Option Explicit
Function GetValueAndComment(FCell As Range) As Variant

Application.Volatile

Dim TCell As Range

Set TCell = Application.Caller

If TCell.Comment Is Nothing Then
'do nothing
Else
TCell.Comment.Delete
End If

If FCell.Comment Is Nothing Then
'do nothing
Else
TCell.AddComment Text:=FCell.Comment.Text
End If

If FCell.Value = "" Then
GetValueAndComment = ""
Else
GetValueAndComment = FCell.Value
End If

End Function

You'd use it like this:
=GetValueAndComment(A1)

The value in A1 would appear in the cell and the comment would get copied, too.

The application.volatile is there to update the comments if you change them.
(Changing the comment won't make the function run, but it'll catch up with the
next recalculation.)

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

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:
=GetValueAndComment(A1)

Corkey wrote:

Hi there. I am using multiple worksheets for work and each employee has their
own sheets where they enter their daily numbers. The employee sheets are
linked to a master and updated automatically. However, if they put a comment
in the cell for a particular day, it is not copied over with the formula. I
know that it is possible if you use the copy and paste special function but I
am using the = function to copy from one worksheet to another (daily
sheet.xls]Aug 07 - Sept 07'!$B$4). Since I am only using the = function, the
comment is not forwarded? Any way I can change that? Please help€¦ I am
totally frustrated. Thanks a million in advance.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Having comments copied when using formulas

Hi Dave - thanks for the great advice. It worked great except when I close
the other spreadsheet for the employee, I get a #value error on the master.
If I open the employee's sheet back up, it shows the values. Is there any way
to be sure the values in the master workbook stays even after the separate
sheets are closed? thanks a bunch

"Dave Peterson" wrote:

First, I think I'd ask them to use an adjacent column for their comments. It
would make things lots easier for you and them (they could filter by that
additional column to see various comments).

But if you want...

You'll need a macro.

Saved from a previous post:

If you want to use a user defined function to get the value and the comment --
but not the formatting, you could use:

Option Explicit
Function GetValueAndComment(FCell As Range) As Variant

Application.Volatile

Dim TCell As Range

Set TCell = Application.Caller

If TCell.Comment Is Nothing Then
'do nothing
Else
TCell.Comment.Delete
End If

If FCell.Comment Is Nothing Then
'do nothing
Else
TCell.AddComment Text:=FCell.Comment.Text
End If

If FCell.Value = "" Then
GetValueAndComment = ""
Else
GetValueAndComment = FCell.Value
End If

End Function

You'd use it like this:
=GetValueAndComment(A1)

The value in A1 would appear in the cell and the comment would get copied, too.

The application.volatile is there to update the comments if you change them.
(Changing the comment won't make the function run, but it'll catch up with the
next recalculation.)

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

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:
=GetValueAndComment(A1)

Corkey wrote:

Hi there. I am using multiple worksheets for work and each employee has their
own sheets where they enter their daily numbers. The employee sheets are
linked to a master and updated automatically. However, if they put a comment
in the cell for a particular day, it is not copied over with the formula. I
know that it is possible if you use the copy and paste special function but I
am using the = function to copy from one worksheet to another (daily
sheet.xls]Aug 07 - Sept 07'!$B$4). Since I am only using the = function, the
comment is not forwarded? Any way I can change that? Please help€¦ I am
totally frustrated. Thanks a million in advance.


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Having comments copied when using formulas

I read your multiple sheets as multiple sheets within the same workbook.

About the only thing you could do is to convert the formulas to values before
you close the other workbooks.



Corkey wrote:

Hi Dave - thanks for the great advice. It worked great except when I close
the other spreadsheet for the employee, I get a #value error on the master.
If I open the employee's sheet back up, it shows the values. Is there any way
to be sure the values in the master workbook stays even after the separate
sheets are closed? thanks a bunch

"Dave Peterson" wrote:

First, I think I'd ask them to use an adjacent column for their comments. It
would make things lots easier for you and them (they could filter by that
additional column to see various comments).

But if you want...

You'll need a macro.

Saved from a previous post:

If you want to use a user defined function to get the value and the comment --
but not the formatting, you could use:

Option Explicit
Function GetValueAndComment(FCell As Range) As Variant

Application.Volatile

Dim TCell As Range

Set TCell = Application.Caller

If TCell.Comment Is Nothing Then
'do nothing
Else
TCell.Comment.Delete
End If

If FCell.Comment Is Nothing Then
'do nothing
Else
TCell.AddComment Text:=FCell.Comment.Text
End If

If FCell.Value = "" Then
GetValueAndComment = ""
Else
GetValueAndComment = FCell.Value
End If

End Function

You'd use it like this:
=GetValueAndComment(A1)

The value in A1 would appear in the cell and the comment would get copied, too.

The application.volatile is there to update the comments if you change them.
(Changing the comment won't make the function run, but it'll catch up with the
next recalculation.)

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

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:
=GetValueAndComment(A1)

Corkey wrote:

Hi there. I am using multiple worksheets for work and each employee has their
own sheets where they enter their daily numbers. The employee sheets are
linked to a master and updated automatically. However, if they put a comment
in the cell for a particular day, it is not copied over with the formula. I
know that it is possible if you use the copy and paste special function but I
am using the = function to copy from one worksheet to another (daily
sheet.xls]Aug 07 - Sept 07'!$B$4). Since I am only using the = function, the
comment is not forwarded? Any way I can change that? Please help€¦ I am
totally frustrated. Thanks a million in advance.


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Having comments copied when using formulas

thank you for your quick response. I will adjust accordingly.

"Dave Peterson" wrote:

I read your multiple sheets as multiple sheets within the same workbook.

About the only thing you could do is to convert the formulas to values before
you close the other workbooks.



Corkey wrote:

Hi Dave - thanks for the great advice. It worked great except when I close
the other spreadsheet for the employee, I get a #value error on the master.
If I open the employee's sheet back up, it shows the values. Is there any way
to be sure the values in the master workbook stays even after the separate
sheets are closed? thanks a bunch

"Dave Peterson" wrote:

First, I think I'd ask them to use an adjacent column for their comments. It
would make things lots easier for you and them (they could filter by that
additional column to see various comments).

But if you want...

You'll need a macro.

Saved from a previous post:

If you want to use a user defined function to get the value and the comment --
but not the formatting, you could use:

Option Explicit
Function GetValueAndComment(FCell As Range) As Variant

Application.Volatile

Dim TCell As Range

Set TCell = Application.Caller

If TCell.Comment Is Nothing Then
'do nothing
Else
TCell.Comment.Delete
End If

If FCell.Comment Is Nothing Then
'do nothing
Else
TCell.AddComment Text:=FCell.Comment.Text
End If

If FCell.Value = "" Then
GetValueAndComment = ""
Else
GetValueAndComment = FCell.Value
End If

End Function

You'd use it like this:
=GetValueAndComment(A1)

The value in A1 would appear in the cell and the comment would get copied, too.

The application.volatile is there to update the comments if you change them.
(Changing the comment won't make the function run, but it'll catch up with the
next recalculation.)

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

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:
=GetValueAndComment(A1)

Corkey wrote:

Hi there. I am using multiple worksheets for work and each employee has their
own sheets where they enter their daily numbers. The employee sheets are
linked to a master and updated automatically. However, if they put a comment
in the cell for a particular day, it is not copied over with the formula. I
know that it is possible if you use the copy and paste special function but I
am using the = function to copy from one worksheet to another (daily
sheet.xls]Aug 07 - Sept 07'!$B$4). Since I am only using the = function, the
comment is not forwarded? Any way I can change that? Please help€¦ I am
totally frustrated. Thanks a million in advance.

--

Dave Peterson


--

Dave Peterson

Reply
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
copied formulas on Excel the value doesn't change Jane Excel Worksheet Functions 2 November 27th 06 04:50 AM
formulas in comments in excel u9946675 Excel Discussion (Misc queries) 0 October 26th 06 11:07 AM
copied formulas paste as values Trev Excel Discussion (Misc queries) 2 February 11th 06 05:09 AM
Can formulas stay as they are when copied to MemoryStick? dorter Excel Discussion (Misc queries) 7 November 16th 05 07:47 PM
Delete the formulas of webpage, copied & pasted on excel sheet Mustafa Abedin Excel Discussion (Misc queries) 1 June 19th 05 02:39 PM


All times are GMT +1. The time now is 05:52 AM.

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

About Us

"It's about Microsoft Excel"