Hi guys,
So I think I may be doing something technically wrong.
The code finds the column letter based on a string ("ART start date"), then I am trying to use the column letter in a range to calculate a formula. but it ends up printing the name of the range ("routing_column1 " in the formula instead of using it:
Overall im trying to find the column ART start date, then calculate the month in every row and print the month name in the last column.
Please assist, thanks.
So I think I may be doing something technically wrong.
The code finds the column letter based on a string ("ART start date"), then I am trying to use the column letter in a range to calculate a formula. but it ends up printing the name of the range ("routing_column1 " in the formula instead of using it:
VBA Code:
Sub adding_months()
Dim routing_column1 As Range
last_lin = Worksheets("paste").Cells(Rows.Count, 1).End(xlUp).Row
With ThisWorkbook.Sheets("Paste")
.AutoFilterMode = False
With .Range("A1:FF1")
Set rfind1 = .Find(What:="ART start date", LookAt:=xlWhole, MatchCase:=False, SearchFormat:=False)
If Not rfind1 Is Nothing Then
routing_column1 = Split(rfind1.Address, "$")(1) & "2"
Range(("D2:D" & last_lin)) = "=Month(routing_column1)"
End If
End With
End With
End Sub
Overall im trying to find the column ART start date, then calculate the month in every row and print the month name in the last column.
Please assist, thanks.