Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Replace Worksheet
I have:
WorkbookA with Worksheets A, B, C, and D. WorkbookB with Worksheet Z. I want: To replace sheet C with sheet Z (i.e., WorkbookA now contains sheets A, B, Z, D). Any suggestions? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Replace Worksheet
workbooks("workbookB").worksheets("worksheet Z").copy _ destination:=workbooks("workbookA").worksheets("wo rksheet C") workbooks("workbookA").worksheets("worksheet C").name = "worksheet Z" "DevDaniel" wrote: I have: WorkbookA with Worksheets A, B, C, and D. WorkbookB with Worksheet Z. I want: To replace sheet C with sheet Z (i.e., WorkbookA now contains sheets A, B, Z, D). Any suggestions? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Replace Worksheet
Try something like
Sub AAA() Dim WBA As Workbook Dim WBB As Workbook Set WBA = Workbooks("WBA.xls") '<<< CHANGE Workbook File Name Set WBB = Workbooks("WBB.xls") '<<< CHANGE Workbook File Name Application.DisplayAlerts = False WBB.Worksheets("SheetZ").Copy after:=WBA.Worksheets("SheetC") WBA.Worksheets("SheetC").Delete Application.DisplayAlerts = True End Sub This assumes that workbook WBA.xls and workbook WBB.xls are already open. -- Cordially, Chip Pearson Microsoft MVP - Excel, 10 Years Pearson Software Consulting www.cpearson.com (email on the web site) "DevDaniel" wrote in message ... I have: WorkbookA with Worksheets A, B, C, and D. WorkbookB with Worksheet Z. I want: To replace sheet C with sheet Z (i.e., WorkbookA now contains sheets A, B, Z, D). Any suggestions? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Replace * on the worksheet | Excel Discussion (Misc queries) | |||
Replace #VALUE! in cells of a worksheet | Excel Discussion (Misc queries) | |||
how do I replace a worksheet. | Excel Discussion (Misc queries) | |||
How do I replace a worksheet with another worksheet in excel | Excel Worksheet Functions | |||
Replace worksheet name with a variable | Excel Programming |