excel-2010

Check two values with =VLOOKUP

孤街醉人 提交于 2020-01-25 12:09:05
问题 I have the following sheet: As you can see, there are two groups of data. One group is in A and B and the group which should be checked against the first group group is in D and E Now I want to check each value in the second group against all the values in the first group. I tried to use =VLOOKUP(D2:E2;$A$2:$B$10;2;FALSE) but that only gives me #Value and no boolean back. I really appreciate your answer on this problem!!! 回答1: You can use the following formula in F2: =NOT(ISERROR(MATCH(D2&E2,

Split string after first numeric element

不想你离开。 提交于 2020-01-25 02:22:05
问题 Does someone know a function in Excel that would separate this: Tottenham Court Road 28 Apartment 8 to Tottenham Court Road 28 and Apartment 8 ? Something like "after first number - split to another column". 回答1: Shorter version of the formula approach: Left side =TRIM(LEFT(A1,FIND(" ",A1, MIN(IFERROR(FIND({0,1,2,3,4,5,6,7,8,9},A1),""))))) Right side =TRIM(MID(A1,FIND(" ",A1,MIN(IFERROR(FIND({0,1,2,3,4,5,6,7,8,9},A1),""))),LEN(A1))) Both entered as Array Formulas (press Ctrl-Shift-Enter) 回答2:

VBA Macro Concatenation for Excel

柔情痞子 提交于 2020-01-24 20:48:29
问题 I have a requirement like I have some values in column A and I have multiple values in column B,C,D. If my column contains value X then I want to column header and column A value to be concatenate. For example I have gone through lots of question on Stack Overflow and I didn't found anything helpful. Thanks for your help! 回答1: please try this code. Sub FindValues(ByVal WhereToFind As Range, ByVal WhereToPaste As Range) 'where to find should have the header and values Dim col As Integer 'loop

How compare 3 columns and put yes or no in another column?

一笑奈何 提交于 2020-01-24 18:14:09
问题 Hi, I want to compare six column, meterial with material (a with e), plant with plant and pret with pret, if this columns are equals put in rezultat yes, if not put no. Ex. We have Material 1, Plant ANG, Pret 4.5, i want to search in E meterial 1, plang ANG and compare pret, if pret is equals then put in Rezultat OK. Thanks a lot 回答1: =IF(AND(INDEX(F:F, MATCH(A2,E:E, 0))=B2,INDEX(G:G, MATCH(A2,E:E, 0))=C2), "OK", "Not OK") This will work but only if there are no duplicate values. 回答2: This

Export Data from excel to an XML schema has nested lists within nested lists

混江龙づ霸主 提交于 2020-01-24 13:16:30
问题 Is it possible to export Excel Data to an XML Files where the XML schema has nested lists within other nested lists? What I have tried so far: Googling - I have found one thread that states it can not be done as Excel is inherently a flat table: https://social.msdn.microsoft.com/Forums/vstudio/en-US/8ded1f7a-2f9c-4c5a-aec5-c7bd6c594976/convert-data-from-excel-to-xml-when-schema-includes-list-of-lists?forum=vsto Setting up fake data of two nested lists in an XML file and importing it into

Opening tsv file via Notepad++ and save it in text format

夙愿已清 提交于 2020-01-24 01:49:14
问题 I'm trying to automate a process that where in a folder there are 50+ tsv files. They have to be opened via notepad++ and save it as .txt file in the same folder. Using the below code i'm opening the tsv file in notepad++. MyTxtFile = Shell("C:\Program Files (x86)\Notepad++\notepad++.exe I:\Test\Sample.tsv", 1) However, i have no idea how to save it as txt file by using VBA. Is it doable? If yes kindly teach me how. Thank you in advance :) 回答1: If you only want to rename the files from *.tsv

Generic way to check if a key is in a Collection in Excel VBA

血红的双手。 提交于 2020-01-22 17:44:45
问题 I have different Collections in my code. Some hold Objects (of various kinds), others have types (like Long) within them. Is there a way to check if a key is contained in the Collection that works for types as well as objects? So far I have two functions. First function: Private Function ContainsObject(objCollection As Object, strName As String) As Boolean Dim o As Object On Error Resume Next Set o = objCollection(strName) ContainsObject = (Err.Number = 0) Err.Clear End Function Second

Updating Price List in Excel with vlookup or Index/Match

北城余情 提交于 2020-01-16 08:05:30
问题 I'm a book wholesaler and need to update my price and stock list constantly to share with some customers in excel format; also to use in importing to websites. As in the image above, what I need is a formula for Column D to search for SKU in C2 in A-column for an exact match; return the value from B to the corresponding cell in D column. I have searched countless topics, even found a solution in previous weeks but every time I use the same formula I get N/A or REF error. TIA 回答1: Welcome to

VBA How to access a listbox by name excel-2010

瘦欲@ 提交于 2020-01-16 04:30:12
问题 Below is my VBA code to get a selected item from a listbox. I want to send the name of the listbox as a string then access the list box that way since I can't access the listbox directly because this code is in a seperate module from my worksheet source code. So what I am asking is how do you access a listbox by string. For example, instead of Worksheets("sheet1").ListBox1 I want something like Worksheets("sheet1")."ListBox1" So I can reuse this function as long as I have the name of the

Checking Data Types in a Range

耗尽温柔 提交于 2020-01-15 16:01:54
问题 I am trying to validate the data types of all cells in a user-selected range are the same, using a VBA function. I have the following code (simplified), which works for the most part: Dim vTempRange As Variant Dim vCell As Variant vTempRange = DataRange.Value For Each vCell In vTempRange If Len(vCell) > 0 Then 'Use TypeName(vCell) 'Complete validation here End If Next vCell Sometimes a user may select a column of percentages, sometimes a column of decimal values, and sometimes a time value