目标:
对所有内容进行清晰的过滤,并通过按主按钮返回到数据透视表中的标准列表。该按钮会清除您在 Excel 2010 的 PowerPivot 切片器中所做的某些选择的所有内容。
问题:
没有主按钮可以执行此操作。我应该如何得到它?
信息:
Excel 文档有一个连接到 powerpivot 的数据透视表。此外,我还有三个具有不同选择的切片机。每个切片器都有一个小型过滤器功能。就我而言,我想要一个主按钮来按下它,而不是从切片机上按三次。

我的日期变量格式如下:25_December_2010
一旦我使用
Dim strDate As String
strDate = "25_December_2010"
strDate = Replace(strDate,"_"," ")
MsgBox strDate
Run Code Online (Sandbox Code Playgroud)
肯定会MsgBox弹出一个窗口并显示:2010 年 12 月 25 日。
但是,一旦我尝试将值放入单元格中,例如:
Sheets("Sheet1").Range("A1").Value = strdate
Run Code Online (Sandbox Code Playgroud)
而不是用以下cell内容填充:25 December 2010; Excel 会自行操作并使用令人烦恼的条目配置填充单元格:25-Dec-2010!
如何让我的单元格填充hyphen中间没有字符并且不修剪月份名称?
下面的代码是要导出到excel文件。Visual Studio 发送图片中的错误。这段代码有什么问题?
Imports Microsoft.Office.Interop.Excel
Module Module3
Public Sub OOO()
Dim excel As Application = New Application
Dim workbook As Workbook = New Workbook
Dim worksheet As Worksheet = workbook.ActiveSheet
worksheet.Name = "Export as Excel Project"
worksheet.Cells(1, 1) = "Value1"
worksheet.Cells(2, 1) = "Value2"
worksheet.SaveAs("d:\Actor.xls", Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookDefault)
workbook.Close()
End Sub
End Module
Run Code Online (Sandbox Code Playgroud)
请帮我在EXCEL 2010(VBA)中编写自定义功能.
这就是我需要的:
A1:word = inSquareBrackets(A1)
输出应该是:[word]
我只需要一个将单元格的值括在方括号中的函数.
我试图将一张纸上的两列数据重新排列到另一张纸上的行中,由第一张纸上的列控制.
我正在浏览代码,使用F8命令对其进行调试,并在最后遇到循环命令的问题.我得到一个"Loop without Do"编译错误,最后用Excel突出显示"Loop Until".
这是它应该做的:
"JCX"(10,AttributeRowCounter)单元格和"08-Attribute"(1,AttributeRowCounter)应匹配,并控制"JCX"中哪一行"08-Attribute"(11,AttributeRowCounter)值.
"08-Attribute"(9,AttributeRowCounter)值控制"JCX"中的哪一列放置"08-Attribute"(11,AttributeRowCounter)值.
如果在名为AHU-2的"08-Attribute"(1,AttributeRowCounter)中有一个值列表,则"08-Attribute"(9,AttributeRowCounter)中的相应值列表为"CFM,EAT,LAT,RPM和SP" "然后,在(9,AttributeRowCounter)中带有CFM的"08-Attribute"(11,AttributeRowCounter)中的值进入"JCX"(14,TagNumberRow).
具有RPM的(08,AttributeRowCounter)中的"08-Attribute"(11,AttributeRowCounter)中的值进入"JCX"(16,TagNumberRow).
具有SP in(9,AttributeRowCounter)的"08-Attribute"(11,AttributeRowCounter)中的值进入"JCX"(15,TagNumberRow).
如果"08-Attribute"(11,AttributeRowCounter)中的值在(9,AttributeRowCounter)中有"CFM,SP,RPM和Motor HP"以外的值,则(11,AttributeRowCounter)中的值进入"JCX"(21,TagNumberRow)和(9,AttributeRowCounter)中的值进入"JCX"(20,TagNumberRow).
前面的语句循环,将任何其他非"CFM,SP,RPM和Motor HP"值加载到右侧的下一列,根据需要跳过(Name1,Value1,Name2,Value2,Name3,Value3等).
谁知道发生了什么事?
'Tag Values
Do
With Sheets("08-Attribute")
Copy.Range("9,AttributeRowCounter").Value
Application.WorksheetFunction.VLookup((Sheets("JCX").Cells(10, AttributeRowCounter)), (Sheets("08-Attribute").Cells(1, AttributeRowCounter)), True).Value
With Sheets("08-Attribute")
If "9,AttributeRowCounter" = "CFM" Then
.Range("11,AttributeRowCounter").Value = Sheets("JCX").Range("14,TagNumberRow").Value
ElseIf "9" = "SP" Then
.Range("11,AttributeRowCounter").Value = Sheets("JCX").Range("15,TagNumberRow").Value
ElseIf "9" = "RPM" Then
.Range("11,AttributeRowCounter").Value = Sheets("JCX").Range("16,TagNumberRow").Value
ElseIf "9" = "Motor_HP" Then
.Range("11,AttributeRowCounter").Value = Sheets("JCX").Range("17,TagNumberRow").Value
Else
.Range("9,AttributeRowCounter").Value = Sheets("JCX").Range("20,TagNumberRow").Value
TagValueNameColumn = TagValueNameColumn + 2
.Range("11,AttributeRowCounter").Value = Sheets("JCX").Range("21,TagNumberRow").Value
TagValueNameColumn = TagValueNameColumn + 2 …Run Code Online (Sandbox Code Playgroud) MS-Excel中有很多功能.
但是,为什么他们不在其中添加SUBTRACT和DIVISION功能..?如果您有任何答案,请评论..