2 Private Sub Worksheet_SelectionChange?

A

AJPendragon

I already have 1 Private Sub Worksheet_SelectionChange(ByVal Target As Range)
which allows a combo box to appear on a validation list, but I want to add
another "SelectionChange" to allow a cell to always show the current cell a
cursor is in.

The macro falls over - ambiguous name - I presume you cannot have two
Private Sub Worksheet_SelectionChange(ByVal Target As Range) named the same
in 1 sheet.

Is there a way around this - renaming one does not seem to work.

Sorry but my knowledge of VBA is extremely limited.

Thanks


Andrew
 
T

Tom Ogilvy

Put both activities in the same single SelectionChange procedure.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
' combobox code

' other code
Range("A1").Value = Target.Address
end Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top