Good morning.
I have a general design question that has plagued me for years. Here's some example code:
The code above works fine as long as columns are not added or deleted. Once you do, all references are broken. Is it possible to use a named range instead of specifying a column? That way, when columns are added or deleted everything still works.
These are the things that tend to break:
As it is now, adding or deleting rows is an ordeal that requires changing dozens of macros.
I have a general design question that has plagued me for years. Here's some example code:
VBA Code:
Range(Cells(Selection.Row, 15).Address).Select
Range(ActiveCell.Address).Name = "StartCell"
Sheets("Hyperlinks").Range("F1") = Sheets("Calendar").Range("StartCell")
Sheets("Hyperlinks").Range("A1") = Sheets("Calendar").Range("C" & ActiveCell.Row).Value
The code above works fine as long as columns are not added or deleted. Once you do, all references are broken. Is it possible to use a named range instead of specifying a column? That way, when columns are added or deleted everything still works.
These are the things that tend to break:
VBA Code:
Range(Cells(Selection.Row, 15).Address).Select
VBA Code:
Sheets("Hyperlinks").Range("A1") = Sheets("Calendar").Range("C" & ActiveCell.Row).Value
As it is now, adding or deleting rows is an ordeal that requires changing dozens of macros.