Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Replace hardcoded cell reference
Hi Folks!
Getting my "feet wet" in some VBA. (it's about time!) I'm playing around trying to do this based on another post. I have this formula in cell E1: =IF(ISNA(MATCH(D1,A1:A100,0)),"$A$1",ADDRESS(MAX(( A1:A100=D1)*(ROW(A1:A100))),1)) It returns a cell address. Then I have this event macro that uses the result of that formula: Private Sub Worksheet_Change(ByVal Target As Excel.Range) On Error GoTo enditall Application.EnableEvents = False If Target.Address = "$D$1" Then Application.Goto Reference:=ActiveSheet.Range(ActiveSheet.Range("E1 ")) End If enditall: Application.EnableEvents = True End Sub This works just fine but my question is how can I incorporate the formula (or maybe some better method) directly into the macro and not have to use the worksheet formula? Thanks! Biff |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
use Find without hardcoded value but a value from a cell | Excel Worksheet Functions | |||
Using a cell reference within a macro to find and replace | Excel Discussion (Misc queries) | |||
replace the letters (for collumn) & numbers(row no.) of cell reference only | Excel Programming | |||
find and replace cell reference to a new worksheet | Excel Worksheet Functions | |||
Replace a sheetname with a cell reference to link to another work. | Excel Worksheet Functions |