View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Chakri Chakri is offline
external usenet poster
 
Posts: 1
Default Macro not working properly when the file is shared

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