Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Cory Nelson   on Feb 15 In MS Office Category.

  
Question Answered By: Sarah Campbell   on Feb 15

Dim wSht As Worksheet
Dim shtName As String
shtName = Sheets("Invoice").Range("H11")
For Each wSht In Worksheets
If wSht.Name = shtName Then
MsgBox "Sheet already exists...Make necessary " & _
"corrections and try again."
Exit Sub
End If
Next wSht
Sheets.Add.Name = shtName
Sheets(shtName).Move After:=Sheets(Sheets.Count)
Sheets("Invoice").Range("A1:K33").Copy
Sheets(shtName).Range("A1").PasteSpecial Paste:= _
xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Invoice").Range("A1:K33").Copy
Sheets(shtName).Range("A1").PasteSpecial Paste:= _
xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Add new Sheet and Copy data Or get search suggestion and latest updates.


Tagged: