The problem: To get the user to select the row that contains the data required in another workbook that is open.
I wanted to create something similar as the standard xldialog for selecting a range. (for example when specifying the source data for a chart)
I tried:but get a "Show method dialog class failed" error.Code:Application.Dialogs(xlDialogChartAddData).Show
Then I made my own form that appears similar. My probem in getting the form to function correct is to set the textbox equal to the active cell selected:
The code works if I call it from a command button event, but I don't know how to get it to update everytime the user clicks a new cell in the other workbook.Code:Me.txtTarget = ActiveCell.Value
My code is in a macro as it will function as an add-in, called from a toolbar button.
If it wasn't a foreign workbook, I could have used the following event:
I am using VBscript.Code:Private Sub Worksheet_SelectionChange(ByVal Target As Range) frmTarget.txtTarget = ActiveCell.Value End Sub
Any suggestions?




Reply With Quote