Good day,
I am trying to modify my code to fit my need but I don't quite remember how I got there. I need to change this code to have a cell range on another sheet that I have.
Here is the original code:
If Not Intersect(Target, Range("B5:B30")) Is Nothing Then
Application.EnableEvents = False
For i = 1 To Target ' stops the code looping
tmpArr = tmpArr & "," & i
Next i
With Target
With .Offset(, 1).Resize(.Value)
.NumberFormat = "000"
.Value = Application.Transpose(Split(Mid(tmpArr, 2), ","))
.Formula = "=A$" & .row & "&""/""&TEXT(ROW()-" & .row - 1 & ",""000""""/HS"""""")" 'this line needs changing
.Value = .Value
End With
.Offset(0, -1).Copy .Offset(0, -1).Resize(.Value)
.Offset(0, 1).Select
End With
Application.EnableEvents = True
I need to change the following to instead of having /HS to have / & Sheets("Controls").Range("D3")
I need to have this inserted and I tried different tactics but I am getting errors.
.Formula = "=A$" & .row & "&""/""&TEXT(ROW()-" & .row - 1 & ",""000""""/HS"""""")"
To
.Formula = "=A$" & .row & "&""/""&TEXT(ROW()-" & .row - 1 & ",""000""""/ & Sheets("Controls").Range("D3")"""""")"
Please help
Bookmarks