Hi all,
I am working on the following code:
Option Explicit
Sub Report_Formatting()
Dim Fname As String, Sname As String, LastRow As Long
Fname = InputBox("Please copy and paste the name of the report, here", "REPORT NAME")
If Fname = "" Then Exit Sub
Workbooks.OpenText FileName:="http://sharepoint/Testing/REPORTS/" & Fname & ".csv", DataType:=xlDelimited, _
TextQualifier:=xlTextQualifierNone, FieldInfo:=Array(1, 4), Local:=True
If Len(Fname) < 31 Or Len(Fname) = 31 Then
Sname = Left(Fname, Len(Fname) - 8)
Else
Sname = Left(Fname, 31)
End If
ActiveWorkbook.Worksheets.Add(After:=Sheets(Sheets.Count)).Name = "Summary"
Worksheets(Sname).Activate
LastRow = Range("A" & Rows.Count).End(xlUp).Row
Range("A" & LastRow - 13 & ":A" & LastRow).EntireRow.Cut Sheets("Summary").Range("A1")
With Selection.Font
.Name = "Lucide Console"
.Size = 7
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
ActiveSheet.Columns("A:A").ColumnWidth = 22.71
Rows("1:14").RowHeight = 12
End Sub
It is failing at the line:
Range("A" & LastRow - 13 & ":A" & LastRow).EntireRow.Cut Sheets("Summary").Range("A1")
Can someone please help me fix it.
Thank you,
Gos-C
Bookmarks