AntonioZZZ
07-09-2008, 11:33 PM
hi guys!
here my needs:
i'm trying making a "formula like" userform where the user has to put in some data to execute a macro (the macro needs some range reference to be executed)
i want the userform be like the formula ones, where the textbox can track the address of the selected cells on the sheet.
i tried using workbook_sheetactivate and workbook_sheetselection change events using a mcaro that update the textbox.text with the target address, but it doesn't work...
can anybody hel me? (hope my english is not so bad :-D )
here the code i'm using
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If CalcClass.Visible Then
Call UpdateCalcClass
End If
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
If CalcClass.Visible Then
Call UpdateCalcClass
End If
End Sub
Sub UpdateCalcClass()
CalcClass.txt_range.Text = Target.Address
End Sub
Edited by Aussiebear: When supplying code please use the VBA Tag function
here my needs:
i'm trying making a "formula like" userform where the user has to put in some data to execute a macro (the macro needs some range reference to be executed)
i want the userform be like the formula ones, where the textbox can track the address of the selected cells on the sheet.
i tried using workbook_sheetactivate and workbook_sheetselection change events using a mcaro that update the textbox.text with the target address, but it doesn't work...
can anybody hel me? (hope my english is not so bad :-D )
here the code i'm using
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If CalcClass.Visible Then
Call UpdateCalcClass
End If
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
If CalcClass.Visible Then
Call UpdateCalcClass
End If
End Sub
Sub UpdateCalcClass()
CalcClass.txt_range.Text = Target.Address
End Sub
Edited by Aussiebear: When supplying code please use the VBA Tag function