Hi fellow excel heads... I've yet another of my many stumbling blocks with my novice coding abilities where I have to real in the experts.
my example spreadsheet is designed to refresh the filters every time I change a status in in column F of sheet 1 or any sheet for that matter.
What I want it to do and failing to achieve is for it, if status 'Chain' is selected, it should copy the ref no. in column A of the same line and, insert a new line by calling a macro I have designed for inserting a new newline and then place the copied ref no. into the A column of the new line. The new and old must have the same ref. no. My code is doing everything else other than copying and pasting the ref. no.
my code is here
ub status_refresh()
Dim newVal As String
If ActiveCell.Count > 1 Then Exit Sub
If ActiveCell.Column = 6 Then
'If Target.Column <> 100 Then
newVal = ActiveCell.Value
If newVal <> "" Then
If newVal = "Chain" Then GoTo 400
Application.ScreenUpdating = False
'refreshes the filter to rearrange statuses
Call Refreshfilter
'make sure this row is always hidden. Ihide it because I want to insert a line between 6 & 7 so that all the conditional formatting carries over into new line.
Rows("6:6").Select
Selection.EntireRow.Hidden = True
ActiveSheet.Range("F7").Select
Else
End If
End If
Exit Sub
400:
Set Refno = ActiveCell.Range("A" & ActiveCell.Row)
Call insertnewline
ActiveSheet.Range("A7").Value = Refno
Call Refreshfilter
End Sub
Many thanks in advance.
Bookmarks