Hi All
Was wondering if you could help. I want to by using an input box, ask the sheet that requires reformating, and then select the sheet and re format it.
I have the following code, but I keep getting errors and can't seem to nut out what the problem is.
Private Sub FORMAT_Click()
Call Sheetname
' Delete the blank columns, and the Balance column
Columns("E:E").Select
Selection.Delete Shift:=xlToLeft
Columns("N:N").Select
Selection.Delete Shift:=xlToLeft
'Insert 2 new columns, name and copy format for heading
Columns("E:E").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("D1").Select
ActiveCell.FormulaR1C1 = "Account"
Range("E1").Select
ActiveCell.FormulaR1C1 = "Entity"
Range("F1").Select
ActiveCell.FormulaR1C1 = "Classification"
Range("G1").Select
Selection.Copy
Range("D1:F1").Select
Range("F1").Activate
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub
Sub Sheetname()
'indentify the sheet that requires reformating
Dim Stn As String
Stn = Application.inputbox("What is the name of the sheet you wish to format?")
ThisWorkbook.Worksheets(Stn).Activate
Range("A1").Select
End Sub
Bookmarks