hi
here i have code that give the Compile error As
"Wrong number of argument or argument or invalid Property assignment
actually i want to close the WB which just copy past so save the WB and close the same![]()
Private Sub cmdOK_Click() Dim i As Long Dim NSname As Worksheet Dim Sheetname As String If Not ComboBox1.ListIndex = -1 Then Sheetname = ComboBox1.Value 'InputBox("Please enter new sheet name") Workbooks.Open Filename:= _ "C:\Documents and Settings\g sheet\daily data\target.xls" Windows("Check In Data.xls").Activate Sheets("Today").Select Sheets("Today").Copy After:=Workbooks("target.xls").Sheets(Workbooks("target.xls").Sheets.Count) 'Sheets("Today").Copy After:=Worksheets(Worksheets.Count) 'Sheets("To Day").Copy after:=Workbooks("target.xls").Sheets(1) ActiveSheet.Name = Sheetname ActiveSheet.Unprotect Password:="" ActiveSheet.Range("A3").Value = Sheetname ActiveSheet.Range("L3").Value = Now() ActiveSheet.Protect Password:="" Workbooks.Close SaveChanges:=True 'here is the problem athere than that it's work fine Unload Me Else Unload Me MsgBox "Pick a sheet!", 0, vbNullString End If End Sub
can u help me pl.











LinkBack URL
About LinkBacks

Register To Reply

Bookmarks