excel-formula

Hide rows based on Drop Down list in Excel

末鹿安然 提交于 2020-01-06 01:56:06
问题 This is basically a mail template, containing 3 different types of content. I have an excel sheet with a combo-box list. The list has values 1,2 and 3. & 3 different types of content for them. When any one of them is selected . The remaining content must be hidden. 回答1: Assuming you have validation option set in Range("A1") with different options (1-3 in my example). In the appropriate Sheet module put the following code and change it as needed. Private Sub Worksheet_Change(ByVal Target As

Runtime error '1004' while creating a pivot table

穿精又带淫゛_ 提交于 2020-01-05 20:27:42
问题 I am trying to create a pivot table after copying the data from one workbook to another workbook. Here is the code. Dim ws As Worksheet Set ws = Sheets.Add ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _ "PIVOT_RANGE", Version:=xlPivotTableVersion14). _ CreatePivotTable TableDestination:=ws.Name & "!R1C1", TableName:= _ "PivotTable2", DefaultVersion:=xlPivotTableVersion14 I am seeing different pivot table name every time. Sometimes it shows PivotTable1 and Sometimes

VBA: Format cell on #VALUE Error

此生再无相见时 提交于 2020-01-05 12:21:30
问题 I've created a function that searches a specific value on a range and returns adjacent characteristics. Function Busca(valor As String) Dim bus(0 To 1) bus(0) = Worksheets("Sheet2").Range("A1:A10").Find(valor, LookAt:=xlWhole). _ Offset(0, 1) bus(1) = Worksheets("Sheet2").Range("A1:A10").Find(valor, LookAt:=xlWhole). _ Offset(0, 2) Busca = bus End Function If there is no match for valor in A1:A10 , the function returns {#VALUE,#VALUE} , wich is ok, but I'd like to return instead something

Excel VBA Re-run formulas (update) when any cell in sheet changes

半城伤御伤魂 提交于 2020-01-05 10:09:37
问题 I've written a Function in VBA to return a certain value based on certain cells' values. I execute/run this function in a formula on a certain cell =MyFunction() My problem is, the cells which have the above formula don't automatically update if the cells used in the function (in VBA) are changed. How can I re-run or update or re-execute the above formula if the certain cells that are used are changed? 回答1: You must recode your UDF to achieve the desired volatility. Say you want the UDF to re

VBA EXCEL GOOGLE LOOKUP

十年热恋 提交于 2020-01-05 09:12:27
问题 I found some VBA excel code that allowed the range of key words to be looked up on google and returned the first link. I want to add an input box in the beginning to say get the top 5 links. I have 2000 key words that i need to search on google and return the top few links. Can someone please help me expand this code in order to do that???? Thank you so much! Here is the code provided by another stackoverflow user: Sub XMLHTTP() Dim url As String, lastRow As Long Dim XMLHTTP As Object, html

How do I make this formula support multiple rows/dragging?

走远了吗. 提交于 2020-01-05 08:54:16
问题 Continuation of this thread Formula so far. Match[n] = match criteria, HEADER = header criteria etc. This formula Sums the values of the header cells that match a specific criteria, ie: 6502, with this formula, could match a header /6502, then take the value of RETURNSUM, a named range and add them with other matches. =SUMPRODUCT((RETURNSUM* (MID(HEADER,2,4)=IF(LEN(Match5)=4,Match5&"",Match5&" ")))+(RETURNSUM* (MID(HEADER,2,4)=IF(LEN(Match6)=4,Match6&"",Match6&" ")))+(RETURNSUM* (MID(HEADER,2

Combine duplicate rows with text in columns

帅比萌擦擦* 提交于 2020-01-05 08:28:58
问题 I have data that looks like this: Column A contains multiple duplicate data. I need a formula/solution that will remove duplicate email addresses in column A, but combine data in columns B, C and D. In the end, I need it to look like this: 回答1: If you want a formula, starting in G2 enter this with CTRL + SHIFT + ENTER and copy down: =IFERROR(INDEX($A$2:$A$7,SMALL(IF(FREQUENCY(MATCH($A$2:$A$7,$A$2:$A$7,0),MATCH($A$2:$A$7,$A$2:$A$7,0)),ROW($A$2:$A$7)-ROW($A$2)+1),ROWS($G$2:G2))),"") In cell H2

Non-adjecent cells as input to array function (MIN and ISBLANK)

这一生的挚爱 提交于 2020-01-05 08:25:17
问题 This question was asked and as the answer to the specific question was a typo it was deleted: https://stackoverflow.com/questions/59289065/excel-non-adjecent-cells-as-input-to-array-function-min-and-isblank Here is the question: I'm trying to find the minimum of two (non-adjacent) cells per column and sum these for a number of columns (13 in total). What complicates it is that I'd like the function to treat empty cells as zero. I can get it to work as long as the cells are adjacent, but when

Combine multiple VLOOKUPs

守給你的承諾、 提交于 2020-01-05 08:06:34
问题 How would I combine these together into one?: =IFERROR(VLOOKUP(B2:B11,Sheet2!A:B,2,FALSE),"No Match") =IFERROR(VLOOKUP(B3:B12,Sheet2!D:E,2,FALSE),"No Match") =IFERROR(VLOOKUP(B2:B11,Sheet2!G:H,2,FALSE),"No Match") These are just three but eventually I would need 12 in total to be joined as these are searching team names and there are 12 teams in total. 回答1: If you wish to work through each of the pairs of columns in order, for an example of three pairs, just: =IFERROR(VLOOKUP(B2:B11,Sheet2!A

Count Date Values of Current Month - MS Excel

血红的双手。 提交于 2020-01-05 07:55:13
问题 I have following date values (with time) in Column A. 1/1/2012 8:50 1/1/2012 8:45 1/1/2012 8:55 1/1/2012 8:59 1/1/2012 8:12 3/1/2012 8:30 1/1/2012 9:50 2/1/2012 10:00 Now, I want to get a count of cells from Column A having date values of current Month. I have thought of following formula, but I suspect it will work only in machines having mm-dd-yyyy as System-Date-Format. =COUNTIFS(A:A,">="&DATEVALUE(MONTH(TODAY())&"-1"&"-"&YEAR(TODAY())),A:A,"<"&DATEVALUE(MONTH(TODAY())+1&"-1"&"-"&YEAR