excel

Array Formula Confusion

大憨熊 提交于 2021-02-19 03:45:32
问题 I am struggling with an array formula, that logically seems sound, however it doesn't appear to be working correctly. I have been working on a complex sheet, that is not to include VBA, which has made it formula heavy, and using arrays instead. In the image below, the first part is the problem, for the data shown in columns A-F, I wish to get a sum of the values that match the values in I1:K1. The formula I have used to begin with can be seen in the first image also, this evaluates, pressing

How to create and set a ActiveX Control CommandButton as a variable Excel VBA

£可爱£侵袭症+ 提交于 2021-02-19 03:11:57
问题 I am trying to Create a New ActiveX Control CommandButton with Excel VBA. I have a loop VBA which has worked in the past, theFile1.1.xlsm has the master list of the workbooks. I need to add a CommandButton to ~3200 workbooks, so I will be using the Do-Loop macro. Here is the Loop code for reference. Sub Macro2() Application.ScreenUpdating = False Dim sFile As String Dim wb As Workbook Dim FileName1 As String Dim FileName2 As String Dim wksSource As Worksheet Const scWkbSourceName As String =

Weird content in the clipboard after copy from Excel

◇◆丶佛笑我妖孽 提交于 2021-02-19 02:44:10
问题 I'm trying to get the content of the clipboard in my application to ensure excel compatibility, using : Clipboard clipboard = new Clipboard(Display.getDefault()); String contents = (String) clipboard.getContents(TextTransfer.getInstance()); The problem is, if I have on one column [1, 2, 3], and I select cells [1] and [3], then in the clipboard content I found 1\r\n2\r\n3\r\n instead of just 1 and 3. In other words the clipboard does not seem to handle disjointed cells. Does somebody have an

ADODB SQL Syntax - Access table Inner Join with Excel worksheet

匆匆过客 提交于 2021-02-19 02:36:09
问题 I have a project where users will need to fill out an Excel file and then export the data to an Access database. The data collected in the Excel file will need to be exported in 3 steps: (1) export data set 1 record, (2) query Access for the primary key (auto-number) of the newly imported record, (3) export data set 2 record, which includes the primary key populated as the foreign key. I am able to accomplish the first step by establishing and opening an ADODB connection. However, I am

Can I update an XML node value using a variable in VBA

核能气质少年 提交于 2021-02-19 02:00:08
问题 I am a complete newcomer to learning about XML but OK with VBA in Excel 2010. In Excel VBA I have created a simple CustomXMLPart with 5 nodes under a single root, akin to the example below: < <RefTest> <sRef1>SomeText</sRef1> 'text <sRef2>XYZ234</sRef2> 'text <sRef3>ABC123</sRef3> 'text <dRef4>25/02/1953</dRef4> 'date or text? <iRef5>0</iRef5> 'numeric or text? </RefTest> > This works OK and I can read the values back-in using VBA. My problem is that the node values (at the moment) are

When is it appropriate to explicitly use Err.Clear?

喜夏-厌秋 提交于 2021-02-18 22:12:07
问题 For example, the following function is used for checking whether a workbook is open: Function BookOpen(Bk As String) As Boolean Dim T As Excel.Workbook Err.Clear On Error Resume Next Set T = Application.Workbooks(Bk) BookOpen = Not T Is Nothing Err.Clear On Error GoTo 0 End Function Are these two Err.Clear statements necessary? 回答1: In this example Function BookOpen(Bk As String) As Boolean Dim T As Excel.Workbook Err.Clear On Error Resume Next Set T = Application.Workbooks(Bk) BookOpen = Not

When is it appropriate to explicitly use Err.Clear?

六月ゝ 毕业季﹏ 提交于 2021-02-18 22:10:14
问题 For example, the following function is used for checking whether a workbook is open: Function BookOpen(Bk As String) As Boolean Dim T As Excel.Workbook Err.Clear On Error Resume Next Set T = Application.Workbooks(Bk) BookOpen = Not T Is Nothing Err.Clear On Error GoTo 0 End Function Are these two Err.Clear statements necessary? 回答1: In this example Function BookOpen(Bk As String) As Boolean Dim T As Excel.Workbook Err.Clear On Error Resume Next Set T = Application.Workbooks(Bk) BookOpen = Not

MS Excel Vba Arabic unicode

北城余情 提交于 2021-02-18 19:42:38
问题 I have a text file and a macro enabled excel file. the excel file gets (using vba) the string (arabic text) from the text file per line then put it on the sheet1 cells. The problem is the string is not properly displayed. It is displayed in random Japanese characters. (My windows locale is Japan). Here is my code: Open FilePath For Inputs As #1 Do Until EOF(1) Line Input #1, textline ActiveWorkbook.sheets(1).Cell(1,1).Value = textline 'MsgBox(textline) Loop Close#1 Question: How can I get the

Extract Top 5 Values for Each Group in a List without VBA

狂风中的少年 提交于 2021-02-18 19:36:33
问题 I would like to develop a formula to construct a table of the top 5 titles / values within multiple groups, preferably without VBA. I have attached an example. Since I am new to this forum and require need at least 10 reputation points to post images, I have uploaded a screenshot to: http://i.imgur.com/v1LAkYk.png * Thanks @Scott Craner for adding the image to the post! I have already discovered and reviewed the following thread: Extracting top 5 maximum values (based on group) in excel.

Extract Top 5 Values for Each Group in a List without VBA

橙三吉。 提交于 2021-02-18 19:36:33
问题 I would like to develop a formula to construct a table of the top 5 titles / values within multiple groups, preferably without VBA. I have attached an example. Since I am new to this forum and require need at least 10 reputation points to post images, I have uploaded a screenshot to: http://i.imgur.com/v1LAkYk.png * Thanks @Scott Craner for adding the image to the post! I have already discovered and reviewed the following thread: Extracting top 5 maximum values (based on group) in excel.