Hi all!
I hope everyone is keeping well.
I am trying to convert all my dates in Column A to the End of Month dates from cell A2 to the end of the column of the used range.
I would like to do this for all sheets in the workbook which have the same structure with the DateHeading in column A.
For example, my data in Column a would be:
Date Format: YYYY-MM-DD
DateHeading
2020-04-01 > to become > 2020-04-30
2020-03-22 > to become > 2020-03-31
2020-02-06 > to become > 2020-02-28
2020-01-18 > to become > 2020-01-31
My current code is as follows:
If anyone is able to help me with this, you would be so much help!
Please let me know. I have been trying to solve this since Saturday!
Thank you all and regards,
Manerlao
I hope everyone is keeping well.
I am trying to convert all my dates in Column A to the End of Month dates from cell A2 to the end of the column of the used range.
I would like to do this for all sheets in the workbook which have the same structure with the DateHeading in column A.
For example, my data in Column a would be:
Date Format: YYYY-MM-DD
DateHeading
2020-04-01 > to become > 2020-04-30
2020-03-22 > to become > 2020-03-31
2020-02-06 > to become > 2020-02-28
2020-01-18 > to become > 2020-01-31
My current code is as follows:
VBA Code:
Sub ConvertTheDates1()
Dim x As Integer
numrows = Range("A2", Range("A2").End(xlDown)).Rows.Count
Range("A2").Select
For x = 1 To numrows
numrows = Excel.Application.WorksheetFunction.EOMONTH(Range("A2").Value2, 0)
ActiveCell.Offset(1, 0).Select
Next
End Sub
If anyone is able to help me with this, you would be so much help!
Please let me know. I have been trying to solve this since Saturday!
Thank you all and regards,
Manerlao