NWildblood
Technical User
Hi - any help gratefully received !
I have a very straightforward ms excel formatting macro which for reasons beyond my simple mind gets a Compile Error "Expected Function or variable".
I have run similar macro without a hitch for a long time.
Have just 2 days ago upgraded to 2010.
(The s/sheet is password protected, however have pasted into new workbook and am experiencing the same problem.)
Thanks in advance !
The code is here.
Sub FFUploadKGH()
'
' FFUploadKGH Macro
'
'
Range("A37706").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Columns("E:E").Select
Selection.Replace What:=" ", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.NumberFormat = "@"
Selection.Copy
Application.CutCopyMode = False
Columns("E:E").Select
Selection.Copy
Columns("F:F").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("F3").Select
Selection.AutoFilter
Range("F1").Select
Selection.Delete Shift:=xlToLeft
Range("E2:E8908").Select
Selection.ClearContents
Range("G4:G581").Select
Range(Selection, Selection.End(xlDown)).Select
Range("G4:G9921").Select
Selection.Cut
Range("C4").Select
ActiveSheet.Paste
Columns("C:C").Select
Selection.TextToColumns Destination:=Range("C1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(10, 1)), TrailingMinusNumbers:=True
Columns("C:C").Select
Selection.NumberFormat = "dd/mm/yyyy;@"
Range("D44414").Select
Range(Selection, Selection.End(xlDown)).Select
Range("D47054").Select
Selection.ClearContents
Range("J4").Select
Range(Selection, Selection.End(xlDown)).Select
Range("J4:J7626").Select
Selection.Cut
Range("D4").Select
ActiveSheet.Paste
Range("H4").Select
Range(Selection, Selection.End(xlDown)).Select
Range("H4:H9291").Select
Selection.Cut
Range("G4").Select
ActiveSheet.Paste
Range("I4:M206").Select
Range(Selection, Selection.End(xlDown)).Select
Range("I4:M9336").Select
Selection.ClearContents
Range("B4").Select
ActiveCell.FormulaR1C1 = "=NOW()"
Range("B4").Select
Selection.AutoFill Destination:=Range("B4:B5755")
Range("B4:B5755").Select
Columns("B:B").Select
Selection.NumberFormat = "m/d/yyyy"
Columns("B:B").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("B4").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.SmallScroll Down:=10
Range("B3").Select
MsgBox "Now clear duplicates"
End Sub
"No-one got everything done by Friday except Robinson Crusoe...
I have a very straightforward ms excel formatting macro which for reasons beyond my simple mind gets a Compile Error "Expected Function or variable".
I have run similar macro without a hitch for a long time.
Have just 2 days ago upgraded to 2010.
(The s/sheet is password protected, however have pasted into new workbook and am experiencing the same problem.)
Thanks in advance !
The code is here.
Sub FFUploadKGH()
'
' FFUploadKGH Macro
'
'
Range("A37706").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Columns("E:E").Select
Selection.Replace What:=" ", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.NumberFormat = "@"
Selection.Copy
Application.CutCopyMode = False
Columns("E:E").Select
Selection.Copy
Columns("F:F").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("F3").Select
Selection.AutoFilter
Range("F1").Select
Selection.Delete Shift:=xlToLeft
Range("E2:E8908").Select
Selection.ClearContents
Range("G4:G581").Select
Range(Selection, Selection.End(xlDown)).Select
Range("G4:G9921").Select
Selection.Cut
Range("C4").Select
ActiveSheet.Paste
Columns("C:C").Select
Selection.TextToColumns Destination:=Range("C1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(10, 1)), TrailingMinusNumbers:=True
Columns("C:C").Select
Selection.NumberFormat = "dd/mm/yyyy;@"
Range("D44414").Select
Range(Selection, Selection.End(xlDown)).Select
Range("D47054").Select
Selection.ClearContents
Range("J4").Select
Range(Selection, Selection.End(xlDown)).Select
Range("J4:J7626").Select
Selection.Cut
Range("D4").Select
ActiveSheet.Paste
Range("H4").Select
Range(Selection, Selection.End(xlDown)).Select
Range("H4:H9291").Select
Selection.Cut
Range("G4").Select
ActiveSheet.Paste
Range("I4:M206").Select
Range(Selection, Selection.End(xlDown)).Select
Range("I4:M9336").Select
Selection.ClearContents
Range("B4").Select
ActiveCell.FormulaR1C1 = "=NOW()"
Range("B4").Select
Selection.AutoFill Destination:=Range("B4:B5755")
Range("B4:B5755").Select
Columns("B:B").Select
Selection.NumberFormat = "m/d/yyyy"
Columns("B:B").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("B4").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.SmallScroll Down:=10
Range("B3").Select
MsgBox "Now clear duplicates"
End Sub
"No-one got everything done by Friday except Robinson Crusoe...