我有一组日期,我必须获得本月的一周,有很多文献说明如何使用VBA代码获取一年中的一周,而不是如何获得当月的周数.例如03年3月13日将进行第3周的第1周,而不是第10周的结果.
所有帮助apreciated
我创建了一个包含许多 .xls 和 .xlsm 工作表的文件夹,该文件夹将分发给公司中的许多人,为了不改变文件夹中工作表的完整性,我想禁用在此文件夹中保存任何文件,保存的所有填充都必须“另存为”在与名为 project.Here 的文件夹不同的位置。这是迄今为止发现的内容。
干杯
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
' Following line will prevent all saving
Cancel = True
' Following line displays the Save As Dialog box
If SaveAsUI Then SaveAsUI = True
' How do I forbid the folders path ???
End Sub
Run Code Online (Sandbox Code Playgroud) 我有一个工作表,我已经为某些单元格定义了名称.这些单元格将在函数中使用,我使用它们的名称来调用它们.
但是,当我用Excel调用函数时,我得到0作为函数的返回值,好像这些名称没有链接或者值为0.
以下是我写的代码."Sum_Len_1","L_W_2"和"L_W_1"是我给源单元格的名称.
Function min_w(depth)
If depth < Sum_Len_1 Then
min_w = L_W_1 * 0.868 * depth / 1000
Else
min_w = L_W_1 * 0.868 * Sum_Len_1 / 1000 + L_W_2 * 0.868 * (depth - Sum_Len_1) / 1000
End If
End Function
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?