Hello Again!
I'm using Excel 2010
I have a range of dates which are 2012012 (DMMYYYY) and I need them to be in the DD/MM/YYYY format. I have little VBA experience but simply formatting the cells to date provides me with 9/12/7408 from 2012012 or simply hashtags.
I don't have any snippets of code which relate to formatting, but here's what I'm using to transfer the information to sheet.
I'm using Excel 2010
I have a range of dates which are 2012012 (DMMYYYY) and I need them to be in the DD/MM/YYYY format. I have little VBA experience but simply formatting the cells to date provides me with 9/12/7408 from 2012012 or simply hashtags.
I don't have any snippets of code which relate to formatting, but here's what I'm using to transfer the information to sheet.
Code:
Sub Carrier_EFF_DT(ws, ws2, aCell, rng, col, LastRow, colName)
'This statement finds the EFF_DT column in the carrier report.
With ws
Set aCell = .Range("A1:ZZ1").Find(What:="EFF_DT", LookIn:=xlValues, LookAt:=xlWhole, _
MatchCase:=False, SearchFormat:=False)
'If the EFF_DT column is found, then:
If Not aCell Is Nothing Then
col = aCell.Column
colName = Split(.Cells(, col).Address, "$")(1)
LastRow = .Range(colName & .Rows.Count).End(xlUp).Row
'This is the range of rows in the column specified (EFF_DT).
Set rng = .Range(colName & "2:" & colName & LastRow)
Debug.Print rng.Address
'This copies your range, and pastes it at H4, or the Effective Date column in the Master Spreadsheet.
rng.Copy Destination:=ws2.Range("H4")
'If the macro was unable to find the EFF_DT column, then it will alert you.
Else
MsgBox "Effective date not found!"
End If
End With
End Sub