excel-2010

Excel - How to count number of rows in range (i.e. various columns) that contain certain string?

三世轮回 提交于 2019-12-02 05:13:42
I have a list A of strings and I want to see if and if yes in how many rows each string is represented in range B. My data looks something like this: List A: E 1 aaa 2 bbb 3 ccc Range B: A B C 1 aaa --- --- 2 bbb ccc bbb 3 aaa --- --- My desired result would be that in list A for "aaa" it would tell me 2, for "bbb" 1 and for "ccc" 1. Have been trying to do this with the below array formula but it doesn't seem to be working: =SUM(IF(COUNTIF(Range B,List A($A1)>0,1,0)) As much as I like to avoid encouraging the use of the volatile OFFSET¹ function , it seems the most likely candidate in this

VBA Count number of series in a chartObject

爷,独闯天下 提交于 2019-12-02 04:25:20
问题 I know this seems straightforward but it doesn't seem to work for me. I have a chart on "Sheet1". It is the only chart on the sheet. I want to get the number of series in the chart. So I use: Debug.Print ThisWorkbook.Sheets("Sheet1").ChartObjects(1).SeriesCollection.Count to get the answer in the immediate window. However VBA gives me a "Object doesn't support property or method" error. Any ideas? 回答1: You need to add in Chart : Debug.Print ThisWorkbook.Sheets("Sheet1").ChartObjects(1).Chart

VBA QueryPerformanceCounter Not Working

ぐ巨炮叔叔 提交于 2019-12-02 04:22:08
问题 I am trying to test the execution time differences between data types after looping through 1 million random numbers per data type (integer, double, decimal, and variant). I took this code from the Microsoft Developer website. I am using Excel 2010. Here is the code: Option Explicit Sub Function1() Module Module1 Declare Function QueryPerformanceCounter Lib "Kernel32" (ByRef X As Long) As Short Declare Function QueryPerformanceFrequency Lib "Kernel32" (ByRef X As Long) As Short Dim Ctr1, Ctr2

Merge elements when exporting to XML

时光总嘲笑我的痴心妄想 提交于 2019-12-02 04:15:17
I'm trying to export a table in Excel to an XML file. I created a schema but I don’t have exactly the result I expect. Here is a simple example of my table: my table . My schema: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="list"> <xs:complexType> <xs:sequence minOccurs="0" maxOccurs="2"> <xs:element name="Group" type="groupType" minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> </xs:element> <xs:complexType name="groupType"> <xs:sequence> <xs:element name="City" type="cityType" /> </xs:sequence> <xs

Exporting Conditional Borders to Excel in SSRS

China☆狼群 提交于 2019-12-02 04:04:05
I have a simple SSRS report with a Tablix and various groupings (1 column grouping, row groupings below) Groupings: Group 1 -- Group 2 ---- Group 3 ------ Group 4 -- Adjacent Group 2 ---- Adjacent Group 3 I am trying to implement a conditional border and while it works exactly as intended in Dev, after deployment and even exporting to PDF however, when I export to excel (where it needs to be) it does the following: The first Group1 grouping displays the border in the correct position (between group 4 and Adj Group 3) however, when exported this is the only grouping that appears correctly. The

Scripting in Excel — Highlighting like values

笑着哭i 提交于 2019-12-02 04:02:10
I am trying to create a macro that will basically highlight like values in column A the same color and alternate between a blue and white coloring. Therefore, exact values are grouped together by color. Hope this makes sense? At this moment I am doing the highlighting manually (but there are 12000+ rows so thats not a smart idea). I am not so great with VBA yet and am still trying to learn more. So basically this macro will check is the value in cell x of column A is the same of cell x+1 in the same column; if it is then they will be highlighted white. Now if cell x+2 is not the same value as

Prevent Excel from reformatting text in the scientific notation [closed]

醉酒当歌 提交于 2019-12-02 03:49:14
I have a PHP script which exports data from database to different formats, including as an Excel document. If a text field contains such a value as 123123123123 , Excel, by default converts it to 1.23123E+11 . Is it possible to prevent this absolutely unnecessary behaviour? Excel Tactics If your goal is to store the number as text (and not do math on it later) and the PHP is exporting as a CSV, a simple solution would be to export the number as a CONCATENATE function. =CONCATENATE(123123123123) renders as 123123123123 in text format when the CSV is opened in Excel (this is for Excel 2010). 来源:

How to edit info in cells displayed via macro code in Excel?

守給你的承諾、 提交于 2019-12-02 03:27:28
I have a macro so that when you highlight a row on sheet1, the macro takes all the info from this row and displays this by itself on sheet2. If you highlight a different row on sheet1, the info on sheet2 is changes to show the info from that row. My problem is that if I change the info displayed on sheet2, it doesn't change the info on sheet1. Is there a way I could add this functionality? I have the following code at the moment: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim myList If Target.Address <> Target.EntireRow.Address Then Exit Sub If Target.Rows.Count > 1 Then Exit

VBA Count number of series in a chartObject

喜夏-厌秋 提交于 2019-12-02 03:24:39
I know this seems straightforward but it doesn't seem to work for me. I have a chart on "Sheet1". It is the only chart on the sheet. I want to get the number of series in the chart. So I use: Debug.Print ThisWorkbook.Sheets("Sheet1").ChartObjects(1).SeriesCollection.Count to get the answer in the immediate window. However VBA gives me a "Object doesn't support property or method" error. Any ideas? You need to add in Chart : Debug.Print ThisWorkbook.Sheets("Sheet1").ChartObjects(1).Chart.SeriesCollection.Count Try this Debug.Print ThisWorkbook.Sheets("Sheet1").ChartObjects(1).Chart

Why is this PivotItem.Visible call throwing a TypeMismatch error?

孤街醉人 提交于 2019-12-02 02:59:27
This is baffling us. I have a standard pivot table with a report filter on it that allows multiple selection of items. I can get the selected items in the report filter with: Dim pi As PivotItem For Each pi In PivotTables("MyPivot").PivotFields("MyField").PivotItems If pi.Visible Then Debug.Print pi.Value End If Next Simple. My collegue has a standard pivot table with a report filter on it that allows multiple selection of items. He tries getting selected items in the report filter with the same code : Dim pi As PivotItem For Each pi In PivotTables("HisPivot").PivotFields("HisField")