CaptainCsaba
Board Regular
- Joined
- Dec 8, 2017
- Messages
- 78
Hey everyone!
I created a macro that would make our job easier. For some odd reason it was working fine and afer addig some lines and then deleting them it started giving me this Object error. I am no expert, I might have accidentally deleted something but I don't know what could be the problem. Does somebody know? The macro looks like this:
I created a macro that would make our job easier. For some odd reason it was working fine and afer addig some lines and then deleting them it started giving me this Object error. I am no expert, I might have accidentally deleted something but I don't know what could be the problem. Does somebody know? The macro looks like this:
Code:
Sub Nortrust2()
'Cella unmergelés és rendezés
Sheet1.Activate
Sheet1.Cells.Select
Selection.UnMerge
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.Delete Shift:=xlToLeft
Sheet1.Activate
Sheet1.Cells.Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlTop
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
'Registration oszlop létrehizása A oszlopban
Columns("A:A").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A1").Select
ActiveCell.FormulaR1C1 = "=LOOKUP(2,1/(RC:RC[25]<>""""),RC:RC[25])"
Range("A1").Select
Selection.AutoFill Destination:=Range("A1:A522")
Range("A1:A5000").Select
Range("A1:A5000").Select
Selection.Copy
Range("A5001").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A5001:A10000").Select
Selection.Copy
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'Fund Manager oszlop létrehozása L oszlopban
Range("L1:AC5000").Select
Selection.SpecialCells(xlCellTypeConstants, 1).Select
Selection.ClearContents
Columns("A:A").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A1").Select
ActiveCell.FormulaR1C1 = "=LOOKUP(2,1/(RC[1]:RC[17]<>""""),RC[1]:RC[17])"
Range("A1").Select
Selection.AutoFill Destination:=Range("A1:A5000")
Range("A1:A5000").Select
Columns("M:M").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Columns("A:A").Select
Selection.Cut Destination:=Columns("M:M")
Columns("A:A").Select
Selection.Delete Shift:=xlToLeft
'Betűtípus és méret rendezés
Range("A1:W5522").Select
With Selection.Font
.Name = "Calibri"
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.TintAndShade = 0
.ThemeFont = xlThemeFontMinor
End With
With Selection.Font
.Name = "Calibri"
.Size = 5
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.TintAndShade = 0
.ThemeFont = xlThemeFontMinor
End With
'Filter és szépítgetés
Cells.Select
Range("A2").Activate
Selection.RowHeight = 7.5
Cells.EntireColumn.AutoFit
Selection.AutoFilter Field:=12, Criteria1:="<>#N/A", _
Operator:=xlAnd
Range("A5001:A10000").Select
Selection.ClearContents
End Sub
Last edited by a moderator: