PDA

View Full Version : Show cell column in userform



mikke3141
10-13-2010, 02:58 AM
Hello,

I have an xlam macro workbook that I use for many different sheets. When I start one of the macros, a UserForm will open asking for the column. How could I show in the form the current column of the active cell.

In the sheet I could use

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
UserForm1.Label1 = ActiveCell.Address
End Sub


However as the macro is not in the active workbook, I would need to use the vba in the class module. There is however no



Private Sub App_SelectionChange(ByVal Wb As Workbook, ByVal
End Sub


What to do? Thank you for your help.

Simon Lloyd
10-13-2010, 02:51 PM
You say the userform opens asking for the column, the column for what purpose, if the userform opens in the active workbook then you can useActivecell.Column