Hi,
I am relatively new to writing Macros but what I want to achieve is within the Excel sheet to search through the data headings, find the corresponding Heading and then select the cell below it.
This is the Macro that I have so far.
Sub OverdueDate()
'
' OverdueDate Macro
'
Sheets("ComplaintsData").Select
Dim DateReceived As Range
Set DateReceived = Range(Rows("1:1")).Select.Find("Date_Received").Offset(1,0).Activate
'If Range("F1").Value = "Date_Received" And Range("P1").Value = "" Then
Range("P1").Select
ActiveCell.FormulaR1C1 = "8_Weeks_Date"
Range("P2").Select
'ActiveCell.FormulaR1C1 = "=RC[-10]+56"
ActiveCell.Formula = Range("DateReceived") + 56
Range("P2").Select
Selection.AutoFill Destination:=Range("P2:P13947")
Range("P2:P13947").Select
ActiveWindow.SmallScroll Down:=111
'Else: MsgBox "Make sure headings on ComplaintsData correspond with headings shown on Control Worksheet"
'End If
End Sub
Can anyone help?
Many Thanks
I am relatively new to writing Macros but what I want to achieve is within the Excel sheet to search through the data headings, find the corresponding Heading and then select the cell below it.
This is the Macro that I have so far.
Sub OverdueDate()
'
' OverdueDate Macro
'
Sheets("ComplaintsData").Select
Dim DateReceived As Range
Set DateReceived = Range(Rows("1:1")).Select.Find("Date_Received").Offset(1,0).Activate
'If Range("F1").Value = "Date_Received" And Range("P1").Value = "" Then
Range("P1").Select
ActiveCell.FormulaR1C1 = "8_Weeks_Date"
Range("P2").Select
'ActiveCell.FormulaR1C1 = "=RC[-10]+56"
ActiveCell.Formula = Range("DateReceived") + 56
Range("P2").Select
Selection.AutoFill Destination:=Range("P2:P13947")
Range("P2:P13947").Select
ActiveWindow.SmallScroll Down:=111
'Else: MsgBox "Make sure headings on ComplaintsData correspond with headings shown on Control Worksheet"
'End If
End Sub
Can anyone help?
Many Thanks