excel-2010

How to get unique values in a column using excel formula

蓝咒 提交于 2020-01-01 04:03:08
问题 I have Excel Data like below JID Val 1001 22 1030 6 1031 14 1041 8 1001 3 2344 8 1030 8 2344 6 1041 8 How do i get the unique JID values like below using formula? UJID 1001 1030 1031 1041 2344 回答1: You can use the remove duplicate function Select the column range Go to Data Tab then click on Remove Duplicates 回答2: Here is a solution to get a list of unique items from your tables There is two parts to this solution. Part 1) Unique Count {=SUM(IF(FREQUENCY(IF($A$2:$A$10<>"",MATCH($A$2:$A$10,$A

Active cell as input to formula

佐手、 提交于 2020-01-01 03:24:32
问题 I was wondering if I can use the active cell, by that I mean the cell that is "highlighted" at a given time with the square border after there was a mouse click there, as an argument in a function. For example, I have created a table with weighted averages with 3 weights: w1 is given in the column headers (kindly see the file below), w2 in the row headers, and w3 which complements w1 and w2 to 1. What I'd like to do is have cells outside the table show the weights the average got when a cell

How to merge multiple excel files

大城市里の小女人 提交于 2019-12-31 07:32:07
问题 I have multiple Excel files, each with two columns. One being the same and the other being different for different files. How can I merge all the files by their common column and save them as a new file? Note: I don't wish to combine them one under the other (using rbind ). Instead, I want to merge them based on the commun column. For R: I have filenames in the following format. percent- 15 knt 03_01__00_51.csv percent- 20 knt 03_01__00_54.csv percent- 25 knt 03_01__00_57.csv Due to the file

Split delimited 2nd and 3rd column data into new rows

最后都变了- 提交于 2019-12-31 05:57:28
问题 I have the following table ID. ID2. String 123. 567, 986 ABC;BCD;ACD 142. 134, 654,1134 AA;BB I want it to be displayed ID ID2 String 123 567 ABC 123 986 BCD 123 ACD 142 134 AA 142 654 bb 142 1134 The values in the ID column are unique. Is there an efficient macro solution to this? I have a very huge set of data. 回答1: With only the starting, concatenated data in the active sheet and ID is in A1, run this macro. Sub split_out() Dim v As Long, vVALs As Variant, vID2s As Variant, vSTRs As

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

孤街浪徒 提交于 2019-12-31 04:44:06
问题 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

vbScript opens up excel but doesn't load macro/modules?

非 Y 不嫁゛ 提交于 2019-12-31 03:51:12
问题 I m in a very weird situation. I created a vbs script that would open my excel file. I had defined vba code in WorkBook_open method. I thought creating a vbs script to open up my excel would invoke my workBook_open method and execute the vba code inside it. But I was wrong. Below is my vbs code. filePath = "E:\data_extracts\mydata.xlsm" Set oExcel = CreateObject("Excel.Application") oExcel.Workbooks.Open(filepath) oExcel.Visible = True oExcel.Run "RefreshDataFromIQY" oExcel.ActiveWorkbook

Incorrect value when counting cells in different versions of Excel

谁说胖子不能爱 提交于 2019-12-30 22:27:35
问题 I have seen some SO users run into an issue when trying to use some variation of Cells.Count ; the VBA code throws an overflow error in some cases. For reference, see comments on this answer: I think this will work, but I get an "overflow" error and it points me to the code "If Master.Cells.SpecialCells(xlCellTypeVisible).Count > 0 Then" --- it seems like it's not filtering for anything in particular – user1556069 and this answer: Is this onyl working (and Cells.Count didnt work) because the

Excel VBA : Auto Generating Unique Number for each row

我的未来我决定 提交于 2019-12-30 14:25:11
问题 I got a requirement for auto filling the row with unique number starting from some value(say 1000). The sheet has 2 columns. When ever I fill a value in 2nd column in each row the first column should auto filled. I have filled 3 rows(1000,1001,1002). Now if i delete the middle row that has the auto generated value as 1001, the row that was initially with the value 1002 gets automatically updated to 1001. But according to my requirement the value should remain unique(it should remain as 1002).

Using a InStr function within a Select Case

流过昼夜 提交于 2019-12-30 08:36:29
问题 This does not seem to be working. Is there a way to do what I am trying to do here? I cant a case to be selected if the value is in a given sting: Select Case gTTD.Cells(r, 4) Case InStr(gTTD.Cells(r, 4), "MASTER LOG") resp = "MM LOG" Case InStr(gTTD.Cells(r, 4), "MASTER MET") resp = "MM MET" Case "PIR" gTTD.Cells(r, 7) = "Martin Trépanier" resp = "Martin Trépanier" End Select I understand why this cant work but is there a way of making it work? thank you Thank you 回答1: Here is a little

Copy values only to new workbook from multiple worksheets

只愿长相守 提交于 2019-12-30 07:26:28
问题 Suppose I have a workbook1.xlsm with multiple worksheets and full of various formulas. I want to create a new workbook2.xlsx which would look exactly the same as workbook1 but in all the cells would be values instead of formulas. I have this macro to copy one sheet from workbook1 : Sub nowe() Dim Output As Workbook Dim FileName As String Set Output = Workbooks.Add Application.DisplayAlerts = False ThisWorkbook.Worksheets("Przestoje").Cells.Copy Selection.PasteSpecial Paste:=xlPasteValues, _