Hello,
I have a protected worksheet that has a certain range of cells set as an Edit Range. I wrote a macro to be able to insert a new line in that edit range, but I can't figure out how to update the Edit Range to include the inserted line. After some research it sounds like maybe the edit range can't be updated but just has to be deleted and then another made with the total range. Is that correct?
One thing I tried was naming the new ranges by the date/time that the macro was run, that way each one will be unique, but I couldn't figure out how to set the title of the range with the timestamp. Am I missing something in here?
Basically, I want to run the insert line macro as many times as I need and have the edit range expand accordingly.
I have a protected worksheet that has a certain range of cells set as an Edit Range. I wrote a macro to be able to insert a new line in that edit range, but I can't figure out how to update the Edit Range to include the inserted line. After some research it sounds like maybe the edit range can't be updated but just has to be deleted and then another made with the total range. Is that correct?
VBA Code:
Dim Tstamp As Date
Tstamp = Now()
ActiveSheet.Protection.AllowEditRanges.Add _
Title:=Tstamp, _
Range:=Selection 'Selection is the new row that the macro just added
Basically, I want to run the insert line macro as many times as I need and have the edit range expand accordingly.