custom dialog box issue

offseyeds

New Member
Joined
Nov 17, 2004
Messages
25
i have seen in a speadsheet were when a user clicked on a cell in column "D" it brought up a dialog box that had a text box where you could write notes in. Lets say $D$6 brought up this note box for the item in $C$6. after the user entered these notes in the dialog box about cell C6 then when you clicked ok it was saved in that dialog box. if you clicked on cell $D$7 then the same dialog box pops up, now blank, and you enter the information about item $C$7. If you click back on cell $D$6 the dialog box comes back up with the original information that you entered into it. I dont know how to make one custom dialog box become a specific note holder for the preceding column. I hope i have explained this well enough. Thanks for any help
 

Some videos you may like

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Chas17

Well-known Member
Joined
Oct 16, 2002
Messages
657
In the VBA Code for Sheet 1

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Set vrange = Range("d1:d500")

For Each cell In Target
If Union(cell, vrange).Address = vrange.Address Then
frmMyComment.Show
End If
Next cell
End Sub

Create a form named: frmMyComment

Code for form:

Private Sub cmdOK_Click()
ActiveCell.ClearComments
If TextBox1 <> "" Then
ActiveCell.AddComment (TextBox1.Text)
End If
Unload Me
End Sub

Private Sub UserForm_Initialize()
Set x = ActiveCell.Comment

If x Is Nothing Then Exit Sub

TextBox1.Text = ActiveCell.Comment.Text
End Sub

Chas
 

offseyeds

New Member
Joined
Nov 17, 2004
Messages
25
Works Perfect! Thank you so much. Thats just what i needed. I appreciate it so much. The people on this board are very helpful and hopefully one of these days i will become half as good as some of you. (y)
 

Watch MrExcel Video

Forum statistics

Threads
1,127,910
Messages
5,627,581
Members
416,255
Latest member
amethystia

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top