I have a formula that looks for a \"Date:\" Value in column A and pastes a formula in the adjacent B cell, but I can\'t figure out how to make the formula dynamic.
So if
Set a variable for the row value and convert it to a string for your formula insert like so
Sub Check()
Dim i As Integer
Dim j As String
'for each row
For i = 8 To 48
If Cells(i, 1).Value = "Date:" Then
'set the string for use in the formula
j = Trim(Str(i))
Cells(i, 2).Formula = "=TEXT(T8,""mmm-dd-yyyy"")& "" | "" &V" & j & "& "" - "" &U" & j & "&"" | Dept: ""&W" & j & ""
End If
Next
End Sub
If your range is really this limited, you would be better of setting a conditional formula directly in your sheet like this:
=IF(A8="Date:",TEXT(T8,"mmm-dd-yyyy") & " | " & V8 & " - " & U8 & " | Dept: " & W8,"")
This will only display the text on the condition that A8 = Date:. Dragging the formula down will increment the row number