Tag: excel vba

如何使用Excel来计算hex格式的按位异或?

我有两个单元格与一串位: 1747F6001E00DB2XXXXX28FE5257645C 和 1C6262C8DBF510F655XXXXXA3BDA58AC 我想XOR二者在一起,以便结果将如0B2594C8C5F5CXXXXX190014698D3CF0 。 我知道我需要在Excel中使用按位XOR操作,因为按位XOR计算器可以在线工作,但是它们使我可以在hex和二进制input数据之间进行select。 BITXOR应该可以工作,但对于hexinput不起作用。

在列标题下插入新find的行

嗨,目前我有一个代码,可以帮助我复制和粘贴信息在外部工作簿基于匹配的条件,如“新加坡”新find的行。 代码将查看外部工作簿中的工作表,并search列中具有“新加坡”的所有行,并将其粘贴到另一个工作簿中。 但我现在面临的问题是,正在复制和粘贴的行与我的列标题重叠,而不是插入到工作表的最后一行。 以下是来自外部工作簿的信息将被粘贴到的图像。 但是,当我运行如下代码: Sub UpdateNewUpcomingProj() Dim wb1 As Workbook, wb2 As Workbook Dim ws1 As Worksheet, ws2 As Worksheet Dim copyFrom As Range Dim lRow As Long '<~~ Not Integer. Might give you error in higher versions of excel Dim strSearch As String Set wb1 = Application.Workbooks.Open("U:\Active Master Project.xlsm") Set ws1 = wb1.Worksheets("New […]

用电子邮件将电子邮件中的Excel工作表的一部分作为PDF附件用button发送

我在上面的标题中有代码,下面的代码将把电子邮件中的Excel表单的PDF发送到单元格中指定的电子邮件地址。 我的问题是它给PDF文件的名称是文件名后跟标签名称。 我将如何编辑下面的代码,以便为文件提供表单中单元格中指定的名称? Sub savePDFandEmailPayPlan() Dim strPath As String, strFName As String Dim OutApp As Object, OutMail As Object 'Create PDF of active sheet only strPath = Environ$("temp") & "\" trailing "\" strFName = ActiveWorkbook.Name strFName = Left(strFName, InStrRev(strFName, ".") – 1) & "_" & ActiveSheet.Name & ".pdf" ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ strPath & strFName, […]

数组不填充0

所以我将10个string存储到一个数组中。 然后,我循环通过一个工作表,并添加更多的元素,从位置10(第11元素)开始数组。 工作正常。 arr = Array("Summary", "Account Summary", "Calendarization", "Vehicles", "Buildings", "Personal Comp", "Comp Equip", _ "Software", "Furn & Fixtures", "Alloc Deprec") With ThisWorkbook.Worksheets("PrintTabCheck") lastRow = .Cells(.Rows.Count, "A").End(xlUp).Row For i = 6 To lastRow If .Cells(i, 4) <> 9999999 Then ReDim Preserve arr(UBound(arr) + 1) arr(UBound(arr)) = .Cells(i, 2).Value Debug.Print arr(UBound(arr)) End If Next End […]

使用工作表1中的值,search工作表2,并将工作表中的值作为工作表3返回

这个问题我在第2页有一堆数据。大约有6k行。 我有一些437我想find。 这些在表1(A栏)中有规定。 对于这些我想复制整个行,并将其放置在工作表3中。工作表1中的值可以在工作表2中多次find,我需要他们。 我的解决scheme,我发现VBAsearch这一切。 但是在437点停止。 Public Sub findfak() Dim lastRowS1 As Long Dim lastRowS2 As Long Dim lastRowS5 As Long Dim i As Long Dim j As Long Dim tempS1 As Long Dim temps2 As Long Dim tempRow As Long lastRowS1 = Sheet1.Cells(Rows.Count, 1).End(xlUp).Row lastRowS2 = Sheet2.Cells(Rows.Count, 1).End(xlUp).Row Application.ScreenUpdating = False For i = […]

为什么我添加和条件在中频function不起作用?

我有下面的表格,我用{=MAX(IF(M21:M28=1,N21:N28))}来得到最大值,根据相同的1号,它给出了正确的值99915如果我想添加另一个条件,例如相同的name=hao和相同的No=1 。 我应该得到916 。 这是我在这里使用的,但给我0 。 不知道为什么? 谢谢 {=MAX(IF(AND(M21:M28=1,L21:L28="hao"),N21:N28))} Name No Value hao 1 10 hao 1 11 rui 2 12 rui 1 213 alvin 2 14 alvin 1 99915 hao 1 916 hao 3 9917

过滤值忽略,而不是值显示

我录制了一个macros来创build一个表格,并在第9列中过滤掉某些值。 我想显示except for Taxes and General所有结果。 生成的代码反过来,过滤你想看到的字段。 我怎样才能切换它,所以我硬编码我不想看到的值。 所以当添加一个新的值时,它也会被自动提取,否则就会被忽略。 LastRow = Sheets(Sheets(1).Name).Cells(Rows.Count, "A").End(xlUp).Row ActiveSheet.ListObjects.Add(xlSrcRange, Range("A1:T" & LastRow), , xlYes).Name = "Table1" ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=9, Criteria1:= _ Array("Intel", "Cisco", "Global", "Local", "HR", "Finance", _ "Cables", "HP"), Operator:=xlFilterValues

将值分配给2维数组

我想获得一些数据,我input另一个macros到一个二维数组,所以我可以应用一个函数的数据,但不pipe我尝试我不断收到错误。 数据包括string和数字。 我总是可以引用单元格,忘记数组,但这会使函数复杂化。 这是我的代码: (声明) Dim nLiens As Byte, nCreditors As Byte Dim SecurityV As Currency, ASecurityV As Currency Const adjuster = 0.9 (相关潜艇) Public Sub VariableDeclaration() nLiens = InputBox("Enter number of liens in security") nCreditors = InputBox("Enter number of creditors") SecurityV = InputBox("Enter security full value") ASecurityV = adjuster * SecurityV Call ODebt End […]

如果在excel中包含公式,如何在一个单元格中提供多种颜色

我有一个配方的细胞 ="Average:"& AVERAGE(C2,C6)& "Items:"& SUM(C2,C6) 我需要在该单元格中的“平均”作为红色。 保持黑色

使用excel vba标记Internet Explorer中的所有checkbox

我试图创buildExcelmacros,这将标记在Internet Explorer页面上的某个表中的75个checkbox 该表的代码是: <TABLE id=ctl00_MasterMain_ucGenConfig_ucConfigContainer_ucConfigPopup_cblSchemes border=0><TBODY> <TR> <TD><INPUT id=ctl00_MasterMain_ucGenConfig_ucConfigContainer_ucConfigPopup_cblSchemes_0 type=checkbox name=ctl00$MasterMain$ucGenConfig$ucConfigContainer$ucConfigPopup$cblSchemes$0><LABEL for=ctl00_MasterMain_ucGenConfig_ucConfigContainer_ucConfigPopup_cblSchemes_0>Start</LABEL></TD></TR> <TR> <TD><INPUT id=ctl00_MasterMain_ucGenConfig_ucConfigContainer_ucConfigPopup_cblSchemes_1 type=checkbox name=ctl00$MasterMain$ucGenConfig$ucConfigContainer$ucConfigPopup$cblSchemes$1><LABEL for=ctl00_MasterMain_ucGenConfig_ucConfigContainer_ucConfigPopup_cblSchemes_1>Start2</LABEL></TD></TR> <TR> <TD><INPUT id=ctl00_MasterMain_ucGenConfig_ucConfigContainer_ucConfigPopup_cblSchemes_2 type=checkbox name=ctl00$MasterMain$ucGenConfig$ucConfigContainer$ucConfigPopup$cblSchemes$2><LABEL for=ctl00_MasterMain_ucGenConfig_ucConfigContainer_ucConfigPopup_cblSchemes_2>Default</LABEL></TD></TR> <TR> 等我尝试了各种方法,但不想玩 With IE.document.getElementsByName("ctl00_MasterMain_ucGenConfig_ucConfigContainer_ucConfigPopup_cblSchemes") .Item.Click end with 和 With IE.document.getElementsByName("checkBoxlist(ctl00_MasterMain_ucGenConfig_ucConfigContainer_ucConfigPopup_cblSchemes)") .Item(0).Checked = True 'Entered End With 和 For Each htmlelement In IE.document.getElementsByName("ctl00_MasterMain_ucGenConfig_ucConfigContainer_ucConfigPopup_cblSchemes") htmlelement.Item(0).Click Next htmlelement 预先感谢任何帮助或线索:)