Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
BobbyVoom
 
Posts: n/a
Default linking comments between spreadsheets

Hi, I'm new to this discussion group and relatively new to Excel. Im afraid
I have no programming experience either.
I am using Excel 2003
I have linked a number of cells between two spreadsheets so that the second
sheet "mirrors" the first one in the relevant cells and updates when changes
are made. I would also like to link the comments in these cells so they are
also mirrored and updated in the second sheet. Is this possible?

Any advice would be welcome,
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Dave Peterson
 
Posts: n/a
Default linking comments between spreadsheets

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)

BobbyVoom wrote:

Hi, I'm new to this discussion group and relatively new to Excel. Im afraid
I have no programming experience either.
I am using Excel 2003
I have linked a number of cells between two spreadsheets so that the second
sheet "mirrors" the first one in the relevant cells and updates when changes
are made. I would also like to link the comments in these cells so they are
also mirrored and updated in the second sheet. Is this possible?

Any advice would be welcome,
Thanks


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.newusers
BobbyVoom
 
Posts: n/a
Default linking comments between spreadsheets

Hi Dave
thanks for this....I tried it out using your "short course" instruction, but
all I get in the cell I used it in is "#NAME?".

I think I would normally see this if I'd entered a formula incorrectly, but
I've checked the formula in the original cell and it seems OK.

I'll certainly have a look at David McRithie's macro intro but, as I'm off
on my hols tomorrow, it will have to wait 'til I get back. In the meantime,
if you have any suggestions for a "quick fix" to the problem, I'd welcome
your suggestions.

many thanks


"Dave Peterson" wrote:

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)

BobbyVoom wrote:

Hi, I'm new to this discussion group and relatively new to Excel. Im afraid
I have no programming experience either.
I am using Excel 2003
I have linked a number of cells between two spreadsheets so that the second
sheet "mirrors" the first one in the relevant cells and updates when changes
are made. I would also like to link the comments in these cells so they are
also mirrored and updated in the second sheet. Is this possible?

Any advice would be welcome,
Thanks


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.newusers
Dave Peterson
 
Posts: n/a
Default linking comments between spreadsheets

My first guess is you didn't put the procedure in the correct location.

BobbyVoom wrote:

Hi Dave
thanks for this....I tried it out using your "short course" instruction, but
all I get in the cell I used it in is "#NAME?".

I think I would normally see this if I'd entered a formula incorrectly, but
I've checked the formula in the original cell and it seems OK.

I'll certainly have a look at David McRithie's macro intro but, as I'm off
on my hols tomorrow, it will have to wait 'til I get back. In the meantime,
if you have any suggestions for a "quick fix" to the problem, I'd welcome
your suggestions.

many thanks

"Dave Peterson" wrote:

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)

BobbyVoom wrote:

Hi, I'm new to this discussion group and relatively new to Excel. Im afraid
I have no programming experience either.
I am using Excel 2003
I have linked a number of cells between two spreadsheets so that the second
sheet "mirrors" the first one in the relevant cells and updates when changes
are made. I would also like to link the comments in these cells so they are
also mirrored and updated in the second sheet. Is this possible?

Any advice would be welcome,
Thanks


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.newusers
BobbyVoom
 
Posts: n/a
Default linking comments between spreadsheets

Hi Dave
yes, thanks, checked it out and I had put the macro into the source
spreadsheet rather than into the sheet I wanted it to work in......Duh! - I
told you I was new to this! Thanks very much for your help, got it working
now
Bobby

"Dave Peterson" wrote:

My first guess is you didn't put the procedure in the correct location.

BobbyVoom wrote:

Hi Dave
thanks for this....I tried it out using your "short course" instruction, but
all I get in the cell I used it in is "#NAME?".

I think I would normally see this if I'd entered a formula incorrectly, but
I've checked the formula in the original cell and it seems OK.

I'll certainly have a look at David McRithie's macro intro but, as I'm off
on my hols tomorrow, it will have to wait 'til I get back. In the meantime,
if you have any suggestions for a "quick fix" to the problem, I'd welcome
your suggestions.

many thanks

"Dave Peterson" wrote:

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)

BobbyVoom wrote:

Hi, I'm new to this discussion group and relatively new to Excel. Im afraid
I have no programming experience either.
I am using Excel 2003
I have linked a number of cells between two spreadsheets so that the second
sheet "mirrors" the first one in the relevant cells and updates when changes
are made. I would also like to link the comments in these cells so they are
also mirrored and updated in the second sheet. Is this possible?

Any advice would be welcome,
Thanks

--

Dave Peterson


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.newusers
Dave Peterson
 
Posts: n/a
Default linking comments between spreadsheets

Glad you got it working.

BobbyVoom wrote:

Hi Dave
yes, thanks, checked it out and I had put the macro into the source
spreadsheet rather than into the sheet I wanted it to work in......Duh! - I
told you I was new to this! Thanks very much for your help, got it working
now
Bobby

"Dave Peterson" wrote:

My first guess is you didn't put the procedure in the correct location.

BobbyVoom wrote:

Hi Dave
thanks for this....I tried it out using your "short course" instruction, but
all I get in the cell I used it in is "#NAME?".

I think I would normally see this if I'd entered a formula incorrectly, but
I've checked the formula in the original cell and it seems OK.

I'll certainly have a look at David McRithie's macro intro but, as I'm off
on my hols tomorrow, it will have to wait 'til I get back. In the meantime,
if you have any suggestions for a "quick fix" to the problem, I'd welcome
your suggestions.

many thanks

"Dave Peterson" wrote:

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)

BobbyVoom wrote:

Hi, I'm new to this discussion group and relatively new to Excel. Im afraid
I have no programming experience either.
I am using Excel 2003
I have linked a number of cells between two spreadsheets so that the second
sheet "mirrors" the first one in the relevant cells and updates when changes
are made. I would also like to link the comments in these cells so they are
also mirrored and updated in the second sheet. Is this possible?

Any advice would be welcome,
Thanks

--

Dave Peterson


--

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
More problems linking spreadsheets dgg9879 Excel Discussion (Misc queries) 2 April 19th 06 01:00 PM
Linking spreadsheets dgg9879 Excel Discussion (Misc queries) 3 April 14th 06 04:36 PM
Linking and updating spreadsheets KC8DCN Excel Discussion (Misc queries) 3 February 17th 06 01:05 PM
Linking Cells from seperate spreadsheets [email protected] Excel Worksheet Functions 3 February 15th 06 02:13 AM
Linking between spreadsheets does not work unless I have both spr. RCppe Excel Discussion (Misc queries) 2 March 30th 05 12:37 AM


All times are GMT +1. The time now is 06:10 AM.

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"