Macro not working properly when the file is shared

C

Chakri

Hi all,

I am encountering a specific scenerio where in I am creating a new file
by copying one of the sheets and renaming that with todays date.
, here starts me problem when I try to share the sheet to work around I
am seeing that th macro is not copying the sheet properly even though i
have given PasteSpecial

The code goes here

Sub Newsheet()
sheetname = Format(Now, "dd-mmm-yyyy")
MsgBox sheetname
sheet_count = Worksheets.Count
'Checking for Replication
Wksnameexists = WorksheetExists(sheetname)
If Wksnameexists = True Then
MsgBox "Sheet exists Cannot Create More than one Instance"
End
Else
r = Sheets(sheet_count).Select(2)
Sheets("Template").Select
Cells.Select
Application.CutCopyMode = False
Selection.Copy
'Adding the Worksheet
Worksheets.Add
ActiveSheet.Name = sheetname
Cells.Select
'Copying the Worksheet
'ActiveSheet.Paste
ActiveSheet.PasteSpecial
Range("A1").Select
End If

End Sub

Please suggest any other scenerio using which i can use the sheet when
its shared.
I tried giving
"ActiveSheet.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False"

I would be very happy for any pointers to resolve this issue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top