简体   繁体   English

Excel VBA:使用同一工作簿中的工作表吗?

[英]Excel VBA: Use a sheet from the same workbook?

The scenario: I have an Excel workbook with a macro that uses a template (from " C:\\Users\\User1\\Desktop\\1.xltx ") to create customized sheets. 方案:我有一个Excel工作簿,其中包含使用模板的宏(来自“ C:\\Users\\User1\\Desktop\\1.xltx ”)来创建自定义工作表。

The problem: I need to make Excel to use the template from the same workbook - I have added the template as a separate sheet ("temp1"). 问题:我需要使Excel才能使用同一工作簿中的模板-我已将模板添加为单独的工作表(“ temp1”)。 I can't seem to figure it out, even though it's probably very simple. 即使看起来很简单,我似乎也无法弄清楚。

The current code: 当前代码:

 Set wks = Sheets.Add(After:=Worksheets(Worksheets.Count), Type:="C:\Users\User1\Desktop\1.xltx")

You probably don't want individual copies of the template for each user. 您可能不需要每个用户的模板的单独副本。 If something on the template changes, you would have to update every copy. 如果模板上的某些内容发生更改,则必须更新每个副本。

Have you thought of talking to your SysAdmin and storing the template (1.xltx) in a common location with Read Only permission for the users? 您是否考虑过与SysAdmin进行交谈并将模板(1.xltx)存储在具有用户只读权限的公共位置?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 EXCEL VBA:将工作表中的工作表复制到其他位置的工作簿中 - EXCEL VBA: Copy Sheet from a workbook to another workbook in different location Excel VBA将内容从一个工作表复制到另一个工作簿工作表 - Excel VBA copy content from one Sheet into other Workbook sheet 使用VBA将Excel工作表链接到同一工作簿中的另一个工作表 - Linking an Excel Sheet to another in the same workbook using VBA 将数据从工作表中的工作表中的工作表1复制到工作表2 - copy data from sheet 1 to sheet 2 in the same workbook in excel Excel VBA; 尝试将数据从工作簿中的一个工作表复制到同一工作簿中的另一工作表时,运行时错误'438' - Excel VBA; Run-time error '438' when trying to copy data from one sheet in a work book to another sheet in the same workbook Excel VBA-如何使用不同的子例程将行从工作簿的行复制到另一个工作簿的工作表 - Excel VBA - How to copy row by row from a sheet of workbook to another Workbook's sheet using different subroutine 从同一 Excel 工作簿中的另一个工作表中检索单元格值 - Retrieving cell values from another sheet in the same excel workbook Excel VBA:将其他工作簿中的内容粘贴到活动工作簿Sheet2中 - Excel VBA: Paste Contents From Other Workbook Into Active Workbook Sheet2 试图将特定范围从工作簿中的许多工作表复制到另一个工作簿中的一个工作表 vba excel? - Trying to copy specific range from many sheets in workbook to one sheet in another workbook vba excel? VBA - 根据汇总 Excel 表格上的条件,将工作簿中的不同模板工作表复制到另一个工作簿的多张工作表中 - VBA - copy different template sheets from a workbook, into multiple sheets of another workbook based on criteria on a summary excel sheet
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM