tonywatsonhelp
Well-known Member
- Joined
- Feb 24, 2014
- Messages
- 3,195
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
I everyone,
i have an ongoing problem with writing macros only for someone to come along and say something like
"can we have 10 dropdowns instead of 8 in sheet "Data"?
and as you can imagine that normally involves inserting two rows but of course my macros still all look at the old columns and rows and i'm sure we have all done it before you now have to go through every macro editing it to the changed ranges.
so I have a big project coming up and iknow this is going to be a problem, so if anyone know how toeasily sole this please let me know any tipes will be helpfull, but also i thought if i used named ranges for everything instead of a range it would move as the sheet moves so as an example here is atypicale macro i will be using ow could i change the range to name range "Testit1"?
i have an ongoing problem with writing macros only for someone to come along and say something like
"can we have 10 dropdowns instead of 8 in sheet "Data"?
and as you can imagine that normally involves inserting two rows but of course my macros still all look at the old columns and rows and i'm sure we have all done it before you now have to go through every macro editing it to the changed ranges.
so I have a big project coming up and iknow this is going to be a problem, so if anyone know how toeasily sole this please let me know any tipes will be helpfull, but also i thought if i used named ranges for everything instead of a range it would move as the sheet moves so as an example here is atypicale macro i will be using ow could i change the range to name range "Testit1"?
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("E61:H70")) Is Nothing Then
If Target.Value = "" Or Target.Value = "Select" Then
Target.RowHeight = 15
Range("E61:H70").Locked = False
Exit Sub
end if
end if
end sub