Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
dear all, i want to copy a sheet in a closed workbook to one of the sheet in
an active workbook. i have the following scripts but i have the problem 1) cannot copy over 2) the vba unable to perform automatically which means there is a dialog box asking to input the workbook name though already mentioned in the script. pls help to modify so that can automatically copy to sheet2. button is sitting in sheet1 in active workbook. Private Sub CommandButton7_Click() Cells.ClearContents p = "\\Server_app\Budget\PC\" f = "Backupofbrm-2004-master.xls" s = "CTC" a = "A1" Range("a1").Value = GetValue(p, f, s, a) End Sub Private Function GetValue(path, file, sheet, ref) ' Retrieves a value from a closed workbook Dim arg As String ' Create the argument arg = "'" & path & "[" & file & "]" & sheet & "'!" & _ Range(ref).Range("A1").Address(, , xlR1C1) ' Execute an XLM macro GetValue = ExecuteExcel4Macro(arg) End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy answer to another worksheet | Excel Discussion (Misc queries) | |||
copy COLUMN from 1 worksheet to another (in a different workbook) | Excel Discussion (Misc queries) | |||
how do I make a copy of a worksheet and retain formulas but not data | Setting up and Configuration of Excel | |||
Need Help to Prevent Copy Function Use in a Read-Only Workbook | Excel Worksheet Functions | |||
Copy worksheet with Pivot Table and break link to original workshe | Excel Worksheet Functions |