Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
BLB BLB is offline
external usenet poster
 
Posts: 1
Default Need to Pull Data into a Comment

I am just learning VBA and am stuck on a procedure I am trying to write
I have 2 worksheets: sheet1 is a summary of sheet2. Example: Th
sheets have the following data:
Sheet1:
A1: 4
Sheet 2:
D5: 1
E6: 3

I want to place a comment in Sheet1 A1 that reads:
AP = 1
Forecast = 3

The "1" and the "3" gets pulled from the Sheet2 D5 and E6 cells an
updates automatically when Sheet1 is activated. I have done this par
with no problem using the following code in the Sheet1 module:

Private Sub Worksheet_Activate()
Range("A1").Comment.Text Text:=Chr(10) & "AP = " _
& Sheets("Calculations").Range("D5").Value & Chr(10) & _
"Forecast = " & Sheets("Calculations").Range("E5").Value
End Sub

Note: Sheets("Calculations") is Sheet2

However, the problem is that there are about 100 cells that need thi
same comment that pulls data from Sheet2, but from different cells.
How do I write the code so that the comment knows where to look o
Sheet2 to pull the data?

Any suggestions at all are much appreciated!

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Need to Pull Data into a Comment

I'd be happy to give it a shot, but you need to clarify
the basis for finding the right cells on sheet 2.

Would it be possible to name the ranges on sheet 2 and
then refer to these names?

John
-----Original Message-----
I am just learning VBA and am stuck on a procedure I am

trying to write.
I have 2 worksheets: sheet1 is a summary of sheet2.

Example: The
sheets have the following data:
Sheet1:
A1: 4
Sheet 2:
D5: 1
E6: 3

I want to place a comment in Sheet1 A1 that reads:
AP = 1
Forecast = 3

The "1" and the "3" gets pulled from the Sheet2 D5 and E6

cells and
updates automatically when Sheet1 is activated. I have

done this part
with no problem using the following code in the Sheet1

module:

Private Sub Worksheet_Activate()
Range("A1").Comment.Text Text:=Chr(10) & "AP = " _
& Sheets("Calculations").Range("D5").Value & Chr(10) & _
"Forecast = " & Sheets("Calculations").Range("E5").Value
End Sub

Note: Sheets("Calculations") is Sheet2

However, the problem is that there are about 100 cells

that need this
same comment that pulls data from Sheet2, but from

different cells.
How do I write the code so that the comment knows where

to look on
Sheet2 to pull the data?

Any suggestions at all are much appreciated!!


---
Message posted from http://www.ExcelForum.com/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
BLB BLB is offline
external usenet poster
 
Posts: 1
Default Need to Pull Data into a Comment

Hi John,

I've attached a simplified example of what I am trying to accomplish.
To find the right cell on sheet 2, it has to search by the category i
column A and by the month, but then also it has to find the MIN and MA
for each month.

Sheet1 is a summary of Sheet 2 where it sums the 2 tables together.
want the comment to break out the 2 numbers so you can see what th
total is comprised of. The cell references on the original example i
this thread do exactly match the attachment, but hopefully you ca
better understand what I am trying to do.

Or maybe trying to do a comment is not the way to go? I just need
window to pop up(that is usually hidden), when you click on that cel
to see the breakdown of the numbers.

Thanks for all your help.
Beck

Attachment filename: forum.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=56910
--
Message posted from http://www.ExcelForum.com

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
Excel to pull data from web Bigpiggy Excel Worksheet Functions 1 February 4th 08 02:47 PM
copy comment content to cell content as data not as comment Lilach Excel Discussion (Misc queries) 2 June 21st 07 12:28 PM
Data entry using pull down Ben010 Excel Discussion (Misc queries) 0 March 22nd 06 12:55 PM
pull data for a company with data in diff cells multiple wrkshts kcoachbiggs Excel Worksheet Functions 0 March 8th 06 09:24 PM
Pull data in a new colour Malcolm Excel Programming 1 February 11th 04 12:11 PM


All times are GMT +1. The time now is 10:09 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"