![]() |
|
#1
|
|||
|
|||
![]()
No problem.
You can use a standard range in the Worksheet_SelectionChange macro by restricting things to specific column and rows, for example column E and rows 4 to 20. Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) 'limit to single cell selection If Target.Count > 1 Then Exit Sub 'limit to specific column If Target.Column <> 5 Then Exit Sub 'limit to specific rows If Target.Row < 4 Or Target.Row > 20 Then Exit Sub ' do what's required, example MsgBox "The sheet address of the cell you just entered is " & Target.Address ' End Sub |
#2
|
|||
|
|||
![]()
Thank you, NoSparks!
I’d thought that selection change as a worksheet function and I was looking for a cell function . . . so skipped over it. Following your suggestion, I’ve now got the selection change working properly: When I select a cell it assigns the cell’s value to a variable. That’s a great step forward. I've now concatenated the value with the Word extension to get the file that I want to open: Dim CellContents as string CellContents = Target.Value DocumentID = CellContents & “.docx” If, as in my example, the cell contains “Gardening-0017”, that concatenation would yield “Gardening-0017.docx”. What Excel command do I look at to open that Word document? Very respectfully, Larry |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Limit min and max number to a cell based on country selection | hussainshaikh1 | Excel | 1 | 02-02-2017 07:06 AM |
How do I trigger a macro from a document? | brucemc777 | Word VBA | 4 | 01-25-2016 01:42 AM |
![]() |
markharper80 | Excel | 3 | 02-16-2015 04:18 PM |
Hyperlink in cell to trigger pop up text box | Carpie | Excel Programming | 0 | 08-13-2013 10:33 AM |
![]() |
pavamaklava | Excel | 1 | 05-12-2010 10:47 PM |