Dear Experts I want to merge Addsheet code into ExportData code bu could not please help.
Code
Private Sub Export_Data()
Sheet1.Range("B2:G17").Select
Selection.Copy
Worksheets.Add
ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, operation:=xlNone, skipblanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("A1:G14").Select
With Selection
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
With Selection
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Cells.Select
Cells.EntireColumn.AutoFit
End Sub
Sub AddSheets()
Dim NewName As String
Another:
OneMore = False
NewName = InputBox("What Do you Want to Name the New Sheet?")
Sheets.Add
ActiveSheet.Name = NewName
If MsgBox("Do you want to Add another Sheet?", vbYesNo) = 6 Then Goto Another
End Sub
Display More