Simple Add to a Macro for Limiting List
Posted on 2012-12-29
I have a Macro that automatically replicates lines in a WS. I need it to stop by either a counter or a specific cell reference. So for example, I'd like to be able to specify that it can increment a total of 10 times or until it reaches say, Cell A17. The choices should be able to operate independently and I'll comment out the choice.
Thank you in advance.
'This code adds a new Case to the end of the last case.
Dim rngNewCase As Range
Dim cht As ChartObject
Dim rngCurrent As Range
Dim rngDesired As Range
Application.DisplayAlerts = False
Set rngNewCase = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Offset(1)
ChartNo = rngNewCase.Row / 3
Set rngCurrent = rngNewCase.Offset(, 2)
Set rngDesired = rngNewCase.Offset(, 3)
ActiveSheet.EnableSelection = xlUnlockedCells