Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50079

[SOLVED] Target Address Problem

$
0
0
I have a spreadsheet using some VBA (I'm still very new to VBA) that uses Target.Address to reference a cell, however if I then insert a row into the spreadsheet above the target reference (in this case E1), the cell reference is no longer valid, how can I change it so that irrespective of how many rows are inserted, the cell reference will update accordingly?

Code:

If Target.Address(0, 0) = "E1" Then
I've tried If Target.Address(False,False) = "E1" but this makes no difference.

Many thanks

Viewing all articles
Browse latest Browse all 50079

Trending Articles