worksheet-function

Excel worksheet change event is not firing

蹲街弑〆低调 提交于 2019-12-24 00:35:21
问题 I have created excel workbook using .NET interop. The excel workbook is created successfully through my C# code. When the user makes any changes in the excel, I want to do some stuff. I have used the ExcelWorkSheet.Change event. But this event is not firing. Here is my code- using Excel = Microsoft.Office.Interop.Excel; public class xxx { static Excel.Application xlApp; static Excel.Workbook xlWorkBook; static Excel.Worksheet xlWorkSheet; static Excel.Worksheet xlWorkSheet1; static Excel

MS Excel LOOKUP from top to bottom column

混江龙づ霸主 提交于 2019-12-23 20:04:28
问题 I have a problem finding a way for LOOKUP to search from top to bottom column. Here's the situation. I need to create a formula for Excel to search for hardware part inside a sentences. Example : Sentence (A1) Customer PC can't turn on. Check motherboard. Motherboard faulty. Replace motherboard. PSU don't have enough power. Replace PSU. Here is lookup range column(HARDWARE) replace PSU replace motherboard result range column(HARDWARE_PART) PSU motherboard The formula I use is LOOKUP(9999

Simple HLOOKUP Failing with Excel 2010

a 夏天 提交于 2019-12-23 18:20:16
问题 I have an Excel spreadsheet (generated by spreadsheet gear, but it's more an Excel problem) that isn't functioning as i would expect when I use HLOOKUPS. I use a simple HLOOKUP to look up the value at a given percent in a table. For two certain values, the HLOOKUP fails. These values are 0.9993 and 0.999. This excel document demonstrates the problem: http://dsokol.com/tokio/excelna.xlsx. Cells C6 and C7 are showing as N/A, when they are intended to be populated with B and C. If I re-key over

Default Range property produces unexpected results

孤街醉人 提交于 2019-12-23 13:34:10
问题 As a follow-up question to an answer I posted here I would like to know why the following doesn't error, is this a possible bug in VBA? Take the following data: If we use the following VBA code, we will receive an error because we need to use the numeric value of the date to match: '//Produces error Debug.Print WorksheetFunction.Match(Range("C3").Value, Range("A1:A14"), 0) and so either of these statements will work: '// Cast to Long Debug.Print WorksheetFunction.Match(CLng(Range("C3").Value)

Any reason to avoid Application.Worksheetfunction?

谁说我不能喝 提交于 2019-12-23 10:28:34
问题 I am writing a macro to iterate over some records and wanted to a for-loop to avoid any chance of infinite while looping like: For i = 0 to COUNT **do stuff with START_CELL.Offset(i,0) Next I couldn't remember how to do a count of things from VBA so a search sent me here: Use VBA to Count Non Blank Cells in a Column. One suggestion was n = Worksheets("Sheet1").Range("A:A").Cells.SpecialCells(xlCellTypeConstants).Count This seemed over complicated, so I did some more digging and decided I was

Excel VBA WorksheetFunction.CountA - not working post upgrade to Office 2010

≡放荡痞女 提交于 2019-12-23 07:50:35
问题 The following piece of code works in Excel prior to 2010: myRange = Range("A:A") NumRows = Application.CountA(myRange) There are 38 cells containing text/values in column A. When the code is run in Excel 2007, NumRows correctly evaluates to 38, however, it (wrongly) evaluates to 65,536 in Excel 2010. Entering the CountA function in-cell works OK in both versions. Similar thread is question 16696891, but there was no answer and the suggestions were, I think, red herrings... Any ideas? 回答1: I'm

Is there way to find duplicate words?

不羁的心 提交于 2019-12-22 20:00:11
问题 So I'm trying to find/make a program that will find all my duplicate words in excel. For example in A1 "someone" in A2 ""person" and ect but I'll have "someone" multiples times or another word and I need to condense that information together. But I need to do it in a way where I don't search manually to concatenate duplicates. So is there a way to find the duplicate words and concatenate them? I have also been looking into doing it using "FIND" to look for them but it has yielded no luck yet.

Excel, multiple cells, one value

时光总嘲笑我的痴心妄想 提交于 2019-12-22 17:18:09
问题 I had no idea where to start in Googling... I have a workbook and want to have 2 cells on different sheets where if one is updated, so is the other. However I want to be able to change either cell and the other to update... Is this possible? 回答1: You can add a macro fired by the Worksheet Changed event which monitors for changes in either of those cells and copies the change to the other cell. MSDN Docs on Event 回答2: Open up your VB editor in Excel and use something like the following in each

How to remove a particular word in an Excel cell?

拈花ヽ惹草 提交于 2019-12-22 14:07:01
问题 How do you remove a particular word in a column of one cell that's in another cell in Excel. Example: if A1 = *1603 Ad street New York* , B1 = *New York* then in C1 I want = *1603 Ad street* 回答1: Use the Substitute function: =SUBSTITUTE(A1,B1,"") EDIT: Per brettdj's suggestion, added TRIM to get rid of leading or trailing spaces: =TRIM(SUBSTITUTE(A1,B1,"")) 回答2: Just use the Replace function. leave " replace with" blank 回答3: Try this formula for range of words: =TRIM(SUBSTITUTE(A1,INDEX($B$1:

How to remove a particular word in an Excel cell?

狂风中的少年 提交于 2019-12-22 14:05:03
问题 How do you remove a particular word in a column of one cell that's in another cell in Excel. Example: if A1 = *1603 Ad street New York* , B1 = *New York* then in C1 I want = *1603 Ad street* 回答1: Use the Substitute function: =SUBSTITUTE(A1,B1,"") EDIT: Per brettdj's suggestion, added TRIM to get rid of leading or trailing spaces: =TRIM(SUBSTITUTE(A1,B1,"")) 回答2: Just use the Replace function. leave " replace with" blank 回答3: Try this formula for range of words: =TRIM(SUBSTITUTE(A1,INDEX($B$1: