J
John
I would appreciate if someone could assist me with the following code which
I took and modified from an existing macro that carries out a similiar
function to what I want to do now, except I am getting a Compile error at
the following line
ActiveCell.Formula = "=PROPER(F2&" "&G2)"
My full code is
Sub Format_Query()
Sheets("Database").Select
Range("A1").Select
Columns("L:M").Select
Application.CutCopyMode = False
Selection.NumberFormat = "DD/MM/YY"
Columns("P").Select
Application.CutCopyMode = False
Selection.NumberFormat = "DD/MM/YY"
Columns("Q:Q").Select
Application.CutCopyMode = False
Selection.NumberFormat = "?#,##0.00"
Columns("B:B").Select
Selection.Replace What:="1", Replacement:="Crew", LookAt:=xlPart _
, SearchOrder:=xlByRows, MatchCase:=False
Selection.Replace What:="99", Replacement:="Management", LookAt:=xlPart
_
, SearchOrder:=xlByRows, MatchCase:=False
Columns("D").Select
Selection.Replace What:="10", Replacement:="Full Time", LookAt:=xlPart _
, SearchOrder:=xlByRows, MatchCase:=False
Selection.Replace What:="11", Replacement:="Part Time", LookAt:=xlPart _
, SearchOrder:=xlByRows, MatchCase:=False
ActiveWorkbook.PrecisionAsDisplayed = False
Range("S2").Select
ActiveCell.Formula = "=PROPER(F2&" "&G2)"
Range("S2.S2").Copy
x = 2
Do Until Cells(x, 7).Value = ""
Cells(x, 5).PasteSpecial xlPasteFormulas
x = x + 1
Loop
End With
Sheets("Database").Select
Range("A1").Select
End Sub
I took and modified from an existing macro that carries out a similiar
function to what I want to do now, except I am getting a Compile error at
the following line
ActiveCell.Formula = "=PROPER(F2&" "&G2)"
My full code is
Sub Format_Query()
Sheets("Database").Select
Range("A1").Select
Columns("L:M").Select
Application.CutCopyMode = False
Selection.NumberFormat = "DD/MM/YY"
Columns("P").Select
Application.CutCopyMode = False
Selection.NumberFormat = "DD/MM/YY"
Columns("Q:Q").Select
Application.CutCopyMode = False
Selection.NumberFormat = "?#,##0.00"
Columns("B:B").Select
Selection.Replace What:="1", Replacement:="Crew", LookAt:=xlPart _
, SearchOrder:=xlByRows, MatchCase:=False
Selection.Replace What:="99", Replacement:="Management", LookAt:=xlPart
_
, SearchOrder:=xlByRows, MatchCase:=False
Columns("D").Select
Selection.Replace What:="10", Replacement:="Full Time", LookAt:=xlPart _
, SearchOrder:=xlByRows, MatchCase:=False
Selection.Replace What:="11", Replacement:="Part Time", LookAt:=xlPart _
, SearchOrder:=xlByRows, MatchCase:=False
ActiveWorkbook.PrecisionAsDisplayed = False
Range("S2").Select
ActiveCell.Formula = "=PROPER(F2&" "&G2)"
Range("S2.S2").Copy
x = 2
Do Until Cells(x, 7).Value = ""
Cells(x, 5).PasteSpecial xlPasteFormulas
x = x + 1
Loop
End With
Sheets("Database").Select
Range("A1").Select
End Sub