Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to execute a macro for all the rows which a user pastes a value
into. For example, the user selects cells AJ94, AJ108, AJ120 and pastes a copied value. The problem is that the msgbox returns $AJ$94 3 times. I have (excuse any mistakes I have...I cut a whole bunch of junk) Any thoughts? Private Sub Worksheet_Change(ByVal Target As Range) Application.EnableEvents = True Dim DataRng, TrgtRng As String Dim rng, c As Range DataRng = ActiveWorkbook.Names("trgtrng").RefersToRange.Addr ess €˜trgtrng refers to column AJ in the example If Not Application.Intersect(Target, Range(DataRng)) Is Nothing Then TrgtRng = Target.AddressLocal() Set rng = Range(TrgtRng) For Each c In trng MsgBox ActiveCell.AddressLocal() Next c Endif End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
compare 2 column cells and return the adjacent columns cells data of the cell | Excel Worksheet Functions | |||
Compare 1 cell to column of cells returning adjacent cells info? | Excel Worksheet Functions | |||
Add cells on two adjacent rows but non-adjacent columns | Excel Worksheet Functions | |||
By selecting cells adjacent to cells tally sheet | Excel Worksheet Functions | |||
How do I fill (copy) nonadjacent cells to adjacent cells? | Excel Discussion (Misc queries) |